SUMMARY Digikam crash/core-dump on Face detection with the message: ``` /run/media/miguel/RAW/miguel/RAW/2016/12/13/_DSF2806.RAF: data corrupted at 25233968 terminate called after throwing an instance of 'LibRaw_exceptions' ``` The file indeed it is corrupted. The current photo above (/_DSF2806.RAF) it is not corrupted. I can edit it on LR. However, regardless it is corrupted or not, a corrupted file should not crash digikam. STEPS TO REPRODUCE 1. put a corrupted file on a folder 2. scan for faces on that folder 3. - OBSERVED RESULT crash and core dump EXPECTED RESULT Corrupted photos should be ignored without crashing digikam. SOFTWARE/OS VERSIONS perating System: openSUSE Tumbleweed 20250414 KDE Plasma Version: 6.3.4 KDE Frameworks Version: 6.12.0 Qt Version: 6.9.0 Kernel Version: 6.14.1-1-default (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor Memory: 30.6 GiB of RAM Graphics Processor: AMD Radeon RX 6600 ADDITIONAL INFORMATION file /run/media/miguel/RAW/miguel/RAW/2016/12/13/_DSF2806.RAF /run/media/miguel/RAW/miguel/RAW/2016/12/13/_DSF2806.RAF: Fujifilm RAF raw image data, format version 0201, camera X-T2
If it crashes in Libraw, the bug should be reported to the Libraw team, not here. Can you please make the RAW file available, if not publicly, via my private email. Maik
@Maik Qualmann > If it crashes in Libraw, the bug should be reported to the Libraw team, not here. ok, I will do. > Can you please make the RAW file available, if not publicly, via my private email. I did the file available as an attachment in the original bug report., unless you really want it privately.
I realize that I can not attach the RAF file because it exceeds the max file size.
Git commit a5bf90719fb092cba5bfc8e4a1a02f9ba7a82f0b by Maik Qualmann. Committed on 17/04/2025 at 06:04. Pushed by mqualmann into branch 'master'. do not load corrupt RAW images via magic byte detection with the QImage Loader FIXED-IN: 8.7.0 M +1 -1 NEWS M +5 -0 core/dplugins/dimg/qimage/dimgqimageplugin.cpp https://invent.kde.org/graphics/digikam/-/commit/a5bf90719fb092cba5bfc8e4a1a02f9ba7a82f0b
Thanks for the sample RAW image. Libraw clearly reports a corrupted RAW image, which digiKam also can't display, except for the embedded JPG preview image. It's hard to say what LR displays; it might just be the preview image. Whether the Libraw team can fix something or whether it's an unsupported format is something the Libraw team would have to clarify. I think I read in the Libraw forum that they don't want to load corrupted RAW images for various reasons. Maik
I understand that a corrupted image is not good for any kind of further processing and it should be ignored, but libraw just can not crash and core dump itself and any application that uses libraw code, like digikam. instead , this situation should be identified and a proper exit and return value should indicate upstream that an abnormal situation was occurred , so it could recovery from it , gracefully.
It turns out that digiKam handles the exception from Libraw correctly and doesn't crash. However, the image was then passed to the universal QImage loader (KImageFormats plugin). KImageFormats also has a RAW image loader, and this then crashed. You would then have to report the problem with the example image to KImageFormats. For example, Gwenview crashes with the image because it uses the KImageFormats plugin to load RAW images. However, at digiKam, we generally don't want to load RAW images with the KImageFormats plugin. I saw your bug report on Libraw: https://www.libraw.org/node/2846 Maik