Bug 301483 - sigma raw files and preview (.x3f)
Summary: sigma raw files and preview (.x3f)
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 2.6.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-09 02:22 UTC by Danni Coy
Modified: 2012-06-28 09:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.7.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danni Coy 2012-06-09 02:22:27 UTC
Sigma raw files for newer cameras eg Sigma SD1 are not supported by dcraw or digikam. However these files contain embedded jpeg files for previewing (which are already used to get the image thumbnails); It would be useful if these embedded jpegs could also be used for previewing the image to look at details that are visible from the thumbnail.

Reproducible: Always

Steps to Reproduce:
1. click on sigma raw image (x3f) to preview.
2.
3.
Actual Results:  
image shows up looking like a bunch of noise (libkraw does not decode the image correctly).

Expected Results:  
a reduced size preview of the image should appear.

actually I wouldn't mind if this behaviour was changed for all sigma cameras. DCRaw has a hard time with the files it does support (the jpeg previews usually look better than what it produces).
Comment 1 Marcel Wiesweg 2012-06-09 13:04:40 UTC
Can you provide a sample file for testing?
Comment 2 caulier.gilles 2012-06-09 13:37:52 UTC
We don't use dcraw for RAW handling, but libraw (http://www.libraw.org)

Sound like a wish for libraw as well.

Please provide a sample file for Alex (libraw author)

Also, give us which libraw you use ? Go to Help/Components Info for details.

Marcel : We don't use Exiv2 for raw preview extraction. Right or i'm wrong ? Both are possible (exiv2 or libraw). Typically libraw has a better support of raw file preview than exiv2

Gilles Caulier
Comment 3 Marcel Wiesweg 2012-06-10 16:25:18 UTC
We use exiv2, it gives us a very clean API, we see which previews are available and at which size, and can decide before loading anything if the preview is large enough or too small etc.
Comment 4 caulier.gilles 2012-06-10 21:01:42 UTC
Marcel

if a raw file type mime is not supported by Exiv2, libkdcraw must be used instead. libraw from libkdcraw support X3F. I suspect that X3F is not suported by Exiv2...

Gilles Caulier
Comment 5 Marcel Wiesweg 2012-06-19 18:06:42 UTC
Git commit 14e711ba5d7146fb15d90a9609bfdbfda6dff8c4 by Marcel Wiesweg.
Committed on 19/06/2012 at 20:05.
Pushed by mwiesweg into branch 'master'.

Use libraw as a fallback for RAW preview loading in case exiv2 fails.
Some cleanups and code reuse in the code.

M  +55   -30   libs/threadimageio/previewtask.cpp

http://commits.kde.org/digikam/14e711ba5d7146fb15d90a9609bfdbfda6dff8c4
Comment 6 Marcel Wiesweg 2012-06-19 18:07:56 UTC
The patch enables usage of libraw preview loading. Note I don't have recent .x3f and none was provided here, thus waitingforinfo as I cannot test.
Comment 7 Danni Coy 2012-06-19 23:32:04 UTC
I thought I had added one - but at ~40mb seems to be too big for the tracker - I have published the fire here http://ubuntuone.com/0MiyU3Og5lyaXWoKDtQlSN
Comment 8 Marcel Wiesweg 2012-06-23 17:00:12 UTC
Indeed, Exiv2 fails at this image, but with this fix, the embedded JPEG is extracted by dcraw.