Bug 210371 - Converting a CRW file results in an unusable DNG
Summary: Converting a CRW file results in an unusable DNG
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Bqm-DngConverter (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-12 21:04 UTC by Russell Harrison
Modified: 2018-03-23 11:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.8.0


Attachments
showfoto displaying DNG file converted from CRW, without Exiv2 metadata restoration (325.81 KB, image/jpeg)
2009-10-13 10:52 UTC, caulier.gilles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Russell Harrison 2009-10-12 21:04:12 UTC
Version:           0.7.0 (using KDE 4.3.1)
OS:                Linux
Installed from:    Fedora RPMs

When I attempt to convert CRW files taken with a Canon EOS 300d using either the digiKam batch operation or the stand alone converter I am unable to work with the resulting file.  The thumbnail is all black and none of the raw tools can open it.

I've uploaded a CRW to test with at:
http://russellharrison.com/bugs/kipi-plugins/lake2-row0-06.crw
Comment 1 caulier.gilles 2009-10-13 10:35:38 UTC
I can reproduce the problem here...

Gilles Caulier
Comment 2 caulier.gilles 2009-10-13 10:40:49 UTC
From Libraw and DNG sdk, all sound fine if i use command line tool :

[gilles@localhost test]$ ./raw2dng.shell lake2-row0-06.crw
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Loading RAW data from  "lake2-row0-06.crw"
<unknown program name>(3970)/ KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading metadata  pass  0  of  2
<unknown program name>(3970)/ KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading metadata  pass  1  of  2
<unknown program name>(3970)/ KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading RAW data  pass  0  of  2
<unknown program name>(3970)/ KDcrawIface::KDcrawPriv::progressCallback: LibRaw progress:  Reading RAW data  pass  1  of  2
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Raw data loaded:
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Data Size:      12697856  bytes
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Date:           "2009-10-11T15:53:30"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Make:           "Canon"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Model:          "3088x2056"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Size:           3088 x 2056
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Orientation:    5
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Top margin:     12
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Left margin:    64
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Filter:         "RGGBRGGBRGGBRGGB"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Colors:         3
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- Black:          131
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- White:          4000
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: --- CAM->XYZ:
<unknown program name>(3970)/ DNGIface::DNGWriter::convert:                     "0.8197  -0.2000  -0.1118"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert:                     "-0.6714  1.4335  0.2592"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert:                     "-0.2536  0.3178  0.8266"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert:                     "0.0000  0.0000  0.0000"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Formating RAW data to memory
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG memory allocation and initialization
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG IFD structure creation
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG Negative structure creation
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Updating metadata to DNG Negative
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Build DNG Negative
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG preview image creation
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG thumbnail creation
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: Creating DNG file  "lake2-row0-06.dng"
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: cleanup makernotes using Exiv2
<unknown program name>(3970)/ KExiv2Iface::KExiv2::save: File Extension:  "dng"  is supported for writing mode
<unknown program name>(3970)/ DNGIface::DNGWriter::convert: DNGWriter: DNG conversion complete...

Now i test Exiv2 metadata restoration... here 0.18.1

Question which Exiv2 library version you use ?

Gilles Caulier
Comment 3 caulier.gilles 2009-10-13 10:52:51 UTC
Created attachment 37549 [details]
showfoto displaying DNG file converted from CRW, without Exiv2 metadata restoration

Russell,

I confirm. It's another problem with Exif metadata restoration. Probably a tag is truncated or badly interpreted later with DNG file. We have already seen this problem with another RAW file format converted to DNG (ORF if i remember)

Andreas, Alex, any suggestions ?

Gilles Caulier
Comment 4 caulier.gilles 2009-10-13 10:57:36 UTC
Russell,

I just commented this line :

http://lxr.kde.org/source/extragear/graphics/kipi-plugins/dngconverter/dngwriter/dngwriter.cpp#832

That all... If you want to test on your computer...

Gilles Caulier
Comment 5 caulier.gilles 2009-10-13 11:02:40 UTC
Alex, Andreas,

Here i have uploaded all relevant files : DNG, CRW and Exiftool output...

Please take a look

Gilles
Comment 6 caulier.gilles 2009-10-13 11:04:34 UTC
The url (:=))):

http://digikam3rdparty.free.fr/210371/

Gilles
Comment 7 Alex Tutubalin 2009-10-13 11:08:29 UTC
Please note, that two DNGs are very different in size.
Comment 8 caulier.gilles 2009-10-13 11:11:12 UTC
Alex.

No (:=))). I just completed to upload file. Take a look again...

Gilles
Comment 9 Alex Tutubalin 2009-10-13 11:21:26 UTC
As you can see, the metadata in 'bad' one is really BAD:  look into Color Matrix 1 line and below.

Also, in 'good' one  the Camera Model field is not good too. It is 3088x2056 instead of '300D'. Also not good, because may RAW converters rely on Make/Model fields when selecting processing parameters (i.e. camera profile, black level calculation and so).
Comment 10 caulier.gilles 2009-10-26 13:19:25 UTC
SVN commit 1040540 by cgilles:

for the moment, only touch ORF file to cleanup DNG metadata
BUGS: 210371


 M  +15 -10    dngwriter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1040540