[Digikam-devel] [Bug 182738] Digikam crash on/after image library scan

Andreas Huggel ahuggel at gmx.net
Tue Feb 3 01:29:10 GMT 2009


http://bugs.kde.org/show_bug.cgi?id=182738





--- Comment #12 from Andreas Huggel <ahuggel gmx net>  2009-02-03 02:29:08 ---
Does the console output in comment #10 go with bug #182903?

That's a different assertion (tiffimage.cpp:688) than the one in the original
bug report here (tiffcomposite.cpp:697). From that console output it is clear
that this is a side effect of my changes from last night, not a duplicate of
this bug. Marcel is right in that it is also triggered by the call to
ExifParser::encode from ImageScanner::loadFromDisk but the root cause here is
different.

With this and Gilles' explanations in comment 6: Although the use case is valid
and these are clearly bugs in Exiv2, I think we need to question the design
now: Is it really desirable to call ExifParser::encode right after decoding the
metadata and internally carry metadata in a binary container m_img? Why not
keep it decoded in the Exiv2 metadata containers?

Since 0.18, ExifParser::encode is quite specific and powerful: 

http://dev.exiv2.org/repositories/entry/exiv2/trunk/src/exif.cpp#L463

It tries hard to encode the metadata into a binary block suitable for a JPEG
image. E.g., it deletes certain tags which are not expected in JPEG images and
tries to fit everything into 64kB. This is an expensive operation and may
modify/lose metadata, especially if the source image is not a JPEG image. I
would avoid doing this unless it is really needed. Why not decode the metadata
when digiKam first loads the picture, keep it decoded in a metadata container
all the while, and encode it only when needed for a specific binary target
format.

I think such a design would minimize chances for errors, minimize the loss of
metadata and maximize performance, since decode and encode are the most complex
and expensive operations in Exiv2.

-ahu.


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list