Bug 498879

Summary: Unable to load DNG image - "image cannot be loaded".
Product: [Applications] digikam Reporter: langfristig
Component: DImg-CoreAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.5.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.6.0
Sentry Crash Report:
Attachments: as you can see: Above = JPG but filename is DNG
The picture seen in the screenshot
screenshot to the uploaded picture
another, older, DNG Picture.

Description langfristig 2025-01-19 10:48:07 UTC
Created attachment 177522 [details]
as you can see: Above = JPG but filename is DNG

The picture ist a DNG file; digikam marks it "jpg".
Comment 1 Maik Qualmann 2025-01-19 10:50:36 UTC
*** Bug 498880 has been marked as a duplicate of this bug. ***
Comment 2 Maik Qualmann 2025-01-19 10:52:55 UTC
Please make the image available for us to test, if not public, to my private email.

Maik
Comment 3 langfristig 2025-01-20 08:36:15 UTC
Created attachment 177542 [details]
The picture seen in the screenshot
Comment 4 langfristig 2025-01-20 08:38:33 UTC
Created attachment 177543 [details]
screenshot to the uploaded picture
Comment 5 langfristig 2025-01-20 08:44:14 UTC
Created attachment 177544 [details]
another, older, DNG Picture.

I am of the opinion that Digikam had no problem with the DNG format in older versions...
Comment 6 Maik Qualmann 2025-01-20 11:22:44 UTC
digiKam correctly recognizes that these are not DNG files, the assignment to JPG is correct. The files are clearly not DNG files, but JPG files.

Because of the file extension, we try to load the image with libraw and after the failure we do not try with another loader (in this case via the magic bytes), no image is displayed.

I will fix this, but not the assignment to JPG, because it is correct.

If you rename the images to JPG, they will also be displayed in digiKam.

Maik
Comment 7 caulier.gilles 2025-01-20 11:55:04 UTC
How do you create the DNG file ? Which camera ?  Which software ?
Comment 8 Maik Qualmann 2025-01-20 17:36:59 UTC
Git commit d3c757acb70e37343fdd22666f1b14967b823aae by Maik Qualmann.
Committed on 20/01/2025 at 17:36.
Pushed by mqualmann into branch 'master'.

load wrong RAW image via magic bytes identification
FIXED-IN: 8.6.0

M  +1    -1    NEWS
M  +4    -1    core/libs/threadimageio/preview/previewtask.cpp

https://invent.kde.org/graphics/digikam/-/commit/d3c757acb70e37343fdd22666f1b14967b823aae