Bug 131686 - Crash when viewing/rollover of Sony Alpha 100 raw (.arw) images
Summary: Crash when viewing/rollover of Sony Alpha 100 raw (.arw) images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 0.9.0
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-01 22:28 UTC by J. Westveer
Modified: 2023-05-09 03:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J. Westveer 2006-08-01 22:28:33 UTC
Version:           0.9.0-beta1 (using KDE 3.5.3, Debian Package 4:3.5.3-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-1-686-smp

When pointing mouse over a Sony Alpha 100 raw image (.arw) digikam will crash.
I updated dcraw to try to read these images, and dcraw from the command line does work with these images.  However if one simply runs the mouse over the image (digikam must be then looking for image information) digikam will crash.
The last thing it says is:

..........
Error: Offset of directory ImageSubIfd0,  entry 0x4e70 is out of bounds:
Offset = 0x07b2812b; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xd650 is out of bounds:
Offset = 0x029702f0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xb760 is out of bounds:
Offset = 0x1378a640; truncating the entry
KCrash: Application 'digikam' crashing...


A backtrace shows:

Using host libthread_db library "/lib/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1240877376 (LWP 13386)]
[KCrash handler]
#5  0xb79ed52d in Exiv2::DataValue::toLong (this=0x0, n=0) at value.hpp:307
#6  0xb79e3554 in Exiv2::TiffMetadataDecoder::visitEntry (this=0x0, 
    object=0x0) at tiffvisitor.cpp:152
#7  0xb79de098 in Exiv2::TiffEntry::doAccept (this=0x0, visitor=@0x0)
    at tiffcomposite.cpp:208
#8  0xb79de220 in Exiv2::TiffComponent::accept (this=0x1, visitor=@0x0)
    at tiffcomposite.cpp:203
#9  0xb79de420 in Exiv2::TiffDirectory::doAccept (this=0x8324ec8, 
    visitor=@0x0) at tiffcomposite.cpp:227
#10 0xb79de220 in Exiv2::TiffComponent::accept (this=0x1, visitor=@0x0)
    at tiffcomposite.cpp:203
#11 0xb79de291 in Exiv2::TiffSubIfd::doAccept (this=0x867ad44, 
    visitor=@0xbf89e7c8) at tiffcomposite.cpp:239
#12 0xb79de220 in Exiv2::TiffComponent::accept (this=0x1, visitor=@0x0)
    at tiffcomposite.cpp:203
#13 0xb79de420 in Exiv2::TiffDirectory::doAccept (this=0x83001b0, 
    visitor=@0xbf89e7c8) at tiffcomposite.cpp:227
#14 0xb79de220 in Exiv2::TiffComponent::accept (this=0x1, visitor=@0x0)
    at tiffcomposite.cpp:203
#15 0xb79e1107 in Exiv2::TiffParser::decode (pImage=0x86de5d0, 
    pData=0xb29c5008 "II*", size=12324120, 
    createFct=0xb79e0dd0 <Exiv2::TiffCreator::create(unsigned int, unsigned short)>) at tiffparser.cpp:169
#16 0xb79e08a4 in Exiv2::TiffImage::readMetadata (this=0x86de5d0)
    at tiffimage.cpp:136
#17 0xb7ef4e57 in Digikam::DMetaLoader::loadWithExiv2 ()
   from /usr/lib/libdigikam.so.0
#18 0xb7ef8b5e in Digikam::RAWMetaLoader::load ()
   from /usr/lib/libdigikam.so.0
#19 0xb7ee1d5a in Digikam::DMetadata::load () from /usr/lib/libdigikam.so.0
#20 0xb7ee55eb in Digikam::DMetadata::DMetadata ()
   from /usr/lib/libdigikam.so.0
#21 0xb7d4158a in Digikam::AlbumFileTip::updateText ()
   from /usr/lib/libdigikam.so.0
#22 0xb7d455d2 in Digikam::AlbumFileTip::setIconItem ()
   from /usr/lib/libdigikam.so.0
#23 0xb7d21678 in Digikam::AlbumIconView::slotShowToolTip ()
   from /usr/lib/libdigikam.so.0
#24 0xb7d2b6d6 in Digikam::AlbumIconView::qt_invoke ()
   from /usr/lib/libdigikam.so.0
#25 0xb697a54b in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#26 0xb7d03235 in Digikam::IconView::signalShowToolTip ()
   from /usr/lib/libdigikam.so.0
#27 0xb7d0328a in Digikam::IconView::slotToolTip ()
   from /usr/lib/libdigikam.so.0
#28 0xb7d06248 in Digikam::IconView::qt_invoke ()
   from /usr/lib/libdigikam.so.0
#29 0xb7d2b403 in Digikam::AlbumIconView::qt_invoke ()
   from /usr/lib/libdigikam.so.0
#30 0xb697a54b in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#31 0xb697afdc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#32 0xb6d0e2ae in QTimer::timeout () from /usr/lib/libqt-mt.so.3
#33 0xb699f4a1 in QTimer::event () from /usr/lib/libqt-mt.so.3
#34 0xb691087a in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#35 0xb6910a76 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#36 0xb70bf24e in KApplication::notify () from /usr/lib/libkdecore.so.4
#37 0xb68a2001 in QApplication::sendEvent () from /usr/lib/libqt-mt.so.3
#38 0xb6902305 in QEventLoop::activateTimers () from /usr/lib/libqt-mt.so.3
#39 0xb68b5d2a in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#40 0xb6929255 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#41 0xb692917a in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#42 0xb690f38d in QApplication::exec () from /usr/lib/libqt-mt.so.3
#43 0x0804a6f4 in main ()


The image can be found here:
 http://www.melaque.com/DSC00028.ARW

I hope this is helpfull.
Comment 1 Andreas Huggel 2006-08-02 14:06:59 UTC
That's a bug in exiv2, fixed yesterday - how's that for turnaround time :)

See here http://dev.robotbattle.com/bugs/view.php?id=482
and here http://dev.robotbattle.com/cmtinfo_svn.php?r=10&v=853

Please try with the latest exiv2 from SVN and feedback if you still have problems.

-ahu.




 
Comment 2 J. Westveer 2006-08-02 16:09:48 UTC
the current exiv2 (svn) unfourtunately causes the same simptoms.

digikam: ScanLib: Finding non-existing Albums: 47 ms
Warning: Directory ImageSubIfd0 has an unhandled next pointer.
Error: Offset of directory ImageSubIfd0,  entry 0x4d03 is out of bounds:
Offset = 0x056c1560; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x79e0 is out of bounds:
Offset = 0x01093af0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xd620 is out of bounds:
Offset = 0x225a6402; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xa801 is out of bounds:
Offset = 0xb00c80c1; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x7281 is out of bounds:
Offset = 0x0cb038c0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xaca0 is out of bounds:
Offset = 0x5c5086df; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x0008 is out of bounds:
Offset = 0x03ff200c; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xd805 is out of bounds:
Offset = 0x9c043201; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x05b0 is out of bounds:
Offset = 0x60a86d60; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x6760 is out of bounds:
Offset = 0x42260805; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x548c is out of bounds:
Offset = 0x03e604ec; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x105f is out of bounds:
Offset = 0x72c068c0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x3403 is out of bounds:
Offset = 0x0d003fa0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xc040 is out of bounds:
Offset = 0x04e10b41; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x6548 is out of bounds:
Offset = 0x100aaa00; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x7890 is out of bounds:
Offset = 0x42127c05; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xa890 is out of bounds:
Offset = 0x03f81ec0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xfa02 is out of bounds:
Offset = 0x05dcc029; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x1994 is out of bounds:
Offset = 0x62c14c60; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0x4e70 is out of bounds:
Offset = 0x07b2812b; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xd650 is out of bounds:
Offset = 0x029702f0; truncating the entry
Error: Offset of directory ImageSubIfd0,  entry 0xb760 is out of bounds:
Offset = 0x1378a640; truncating the entry
KCrash: Application 'digikam' crashing...
Comment 3 Andreas Huggel 2006-08-02 16:32:22 UTC
Yeah, that was a bit too optimistic. Please try rev 854 which I just checked in. It has further improved tests. Here the exiv2 command line tool can deal with your sample properly now. (The new Sony camera writes a standard TIFF sub-IFD tag with  corrupted or proprietary data.)

Regards,
Andreas
Comment 4 J. Westveer 2006-08-02 17:24:31 UTC
ooooohh....life is getting better.  Digikam no longer crashes!

I updated exiv2(svn) and digikam, and rebuilt.

Now the main screen comes up, the ARW file is shown as broken.
I can roll/over the file icon and see the attributes.

Digikam reports:

Error: Directory ImageSubIfd0 with 7008 entries considered invalid; not read.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 513 (0x201) encountered.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 514 (0x202) encountered.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 50341 (0xc4a5) encountered.
MissingRequired: /home/MyPhotos/wall/DSC00028.ARW: TIFF directory is missing required "StripOffsets" field.


However, I CAN open the file in digikam-editor.

Comment 5 J. Westveer 2006-08-14 16:11:50 UTC
The "crash" no longer occurs.  With todays digikam (svn) and exiv2 (svn), one can now "roll-over" the image in the main screen and see the image properties.  However, the thumbnail image is only partially displayed.  

Digikam reports...

Error: Directory ImageSubIfd0 with 7008 entries considered invalid; not read.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 513 (0x201) encountered.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 514 (0x202) encountered.
TIFFReadDirectory: Warning, /home/MyPhotos/wall/DSC00028.ARW: unknown field with tag 50341 (0xc4a5) encountered.
MissingRequired: /home/MyPhotos/wall/DSC00028.ARW: TIFF directory is missing required "StripOffsets" field

One can double click the image, and it will come up correctly in the image-editor.

I hope this helps...
Comment 6 caulier.gilles 2006-08-17 01:23:07 UTC
SVN commit 573669 by cgilles:

digikam from trunk : added Sony ALpha RAW file extension by default.
CCBUGS: 131686

 M  +1 -1      rawfiles.h  


--- trunk/extragear/graphics/digikam/libs/dcraw/rawfiles.h #573668:573669
@@ -22,6 +22,6 @@
 #ifndef RAW_FILES_H
 #define RAW_FILES_H
 
-static const char raw_file_extentions[] = "*.bay *.bmq *.cr2 *.crw *.cs1 *.dc2 *.dcr *.dng *.erf *.fff *.hdr *.k25 *.kdc *.mdc *.mos *.mrw *.nef *.orf *.pef *.pxn *.raf *.raw *.rdc *.sr2 *.srf *.x3f";
+static const char raw_file_extentions[] = "*.bay *.bmq *.cr2 *.crw *.cs1 *.dc2 *.dcr *.dng *.erf *.fff *.hdr *.k25 *.kdc *.mdc *.mos *.mrw *.nef *.orf *.pef *.pxn *.raf *.raw *.rdc *.sr2 *.srf *.x3f *.arw";
 
 #endif // RAW_FILES_H
Comment 7 caulier.gilles 2006-08-17 01:35:51 UTC
Your pictures have been taken in vertical orientation. Can you provide a sample in horizontal orientation ? Thank in advance...

Gilles Caulier
Comment 8 caulier.gilles 2006-08-17 01:40:09 UTC
With the last dcraw version 8.29, the preview extraction is broken with ARW files (try "dcraw -e DSC00028.ARW" for example, an look the preview jpeg file content...)

This is a problem in dcraw, not digiKam itself. Please contact the dcraw author to report this problem. Thanks in advance...

Gilles Caulier
Comment 9 caulier.gilles 2006-08-17 01:45:07 UTC
Note : dcraw author is Dave Coffin : dcoffin at cybercom dot net

Gilles
Comment 10 J. Westveer 2006-08-17 02:11:38 UTC
Comment #8 ... I will write Dave Coffin about it. tnx

Comment #7  ... A horizontal photo with the A100 can be found here:

http://www.melaque.com/DSC00626.ARW   (11491964 bytes)

And the in-camera jpeg of same here:

http://www.melaque.com/DSC00626.JPG   (3510372 bytes)

Ciao,

jjw
Comment 11 caulier.gilles 2006-08-17 02:31:37 UTC
SVN commit 573689 by cgilles:

digikam from trunk : do not use dcraw "-2" option to decoding RAW file in 8 bit by default. This will be compatible with dcraw 8.29 realease
CCBUGS: 131686

 M  +2 -3      dcrawpreview.cpp  


--- trunk/extragear/graphics/digikam/libs/dcraw/dcrawpreview.cpp #573688:573689
@@ -109,14 +109,13 @@
         }
     }
 
-    // In second, try to use simple RAW extraction method
+    // In second, try to use simple RAW extraction method in 8 bits ppm output.
     // -c : write to stdout
     // -h : Half-size color image (3x faster than -q)
-    // -2 : 8bit ppm output
     // -a : Use automatic white balance
     // -w : Use camera white balance, if possible
 
-    command  = "dcraw -c -h -2 -w -a ";
+    command  = "dcraw -c -h -w -a ";
     command += QFile::encodeName( KProcess::quote( path ) );
     kdDebug() << "Running dcraw command " << command << endl;
 
Comment 12 J. Westveer 2006-08-18 16:16:41 UTC
dcraw v8.30 does infact fix the last of this problem,
that of displaying the thumbnail of the raw image correctly.

Thanks for all the help!

Ciao

Jim
Comment 13 caulier.gilles 2006-08-18 18:37:17 UTC
Ok, tested with dcraw 8.30 too. Work fine here. I close this file now.

Important comments about EXIV2 library:

Andreas, 

i have checked the header of the ARW file : because Sony alpha camera are based on Minolta Dynax 5D (Sony have buy digital Minolta Camera part in fact), the makernote are exactly the same than Dynax 5D (excepted new tags about some new options !)

Look on the files header provided by J. Westveer, there is a tag witch start with "MLT0" ! this is the minolta Makernote ID ! This can be very trivial to fix Exiv2 library to use Minolta makernote with all ARW files and JPEG files generated by a Sony Alpha camera...

This is want mean that we have 3 camera types witch use Minolta makernote :

- Sony Alpha.
- Minolta camera.
- Olympus camera.

Gilles Caulier
Comment 14 J. Westveer 2006-08-22 03:36:10 UTC
Requested links to sample photos with NO-DRO, DRO, DRO+
(on the camera they are refered to as "D-R")

Location:
http://www.melaque.com/MyPhotos/2006/8-21/

The files are in RAW+JPG format, and are of the same subject matter.

DSC00646.ARW & DSC00646.JPG are NO-DRO
DSC00647.ARW & DSC00647.JPG are DRO
DSC00648.ARW & DSC00648.JPG are DRO+

I will try the exiv2 patch in a bit....

Ciao,

J. Westveer
Comment 15 caulier.gilles 2006-09-05 16:31:47 UTC
*** Bug has been marked as fixed ***.
Comment 16 Nate Graham 2020-11-05 14:19:38 UTC

*** This bug has been marked as a duplicate of bug 405210 ***
Comment 17 caulier.gilles 2023-05-09 03:12:41 UTC
fixed with bug 405210