Summary: | Thumbnail and image view does not update after editing image | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Geoff King <gsking1> |
Component: | Thumbs-Image | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.3 | |
Sentry Crash Report: | |||
Attachments: | Retry saving metadata without IPTC if the first attempt fails |
Description
Geoff King
2007-10-13 19:44:36 UTC
Been messing around with this and have new info. This looks to be related to the IPTC Preview tag that is added by the editor when editing and saving these scanned PNG files as PNG again. Then when save the second generation PNG as JPG the preview tag is carried over into the subsequent JPG files. The PNG files are from xsane and were 16bit PNG. These tags were added and are part of the problem: Iptc.Application2.Preview Undefined 30118 255 216 255 224 0 16 74 70 73 70 0 1 1 2 0 0 0 0 0 0 .....etc... Iptc.Application2.PreviewFormat Short 1 11 Iptc.Application2.PreviewVersion Short 1 1 If i remove Iptc.Application2.Preview using the the following command the files are recognized, and digikam updates the thumbnails. exiv2 -M"del Iptc.Application2.Preview" test1.jpg In summary, the problem I am having appears to be due to the embedded Preview tags that are inserted into the PNG files in the editor when re-saving as a PNG file. This only happens when using original PNG files. 1 Create image using scanner as PNG 2 Use digikam editor on PNG file and save as PNG (preview tag is added) 3 Save as JPG file, preview tag is copied into jpg. 4 Digikam and Nautilus do not like these files with the IPTC Preview 5 Can then manually delete the Iptc.Application2.Preview tag to make things work again. Let me know if you would like a test file. >1 Create image using scanner as PNG
>2 Use digikam editor on PNG file and save as PNG (preview tag is added)
>3 Save as JPG file, preview tag is copied into jpg.
==> normally it's impossible. the code disable IPTC preview tag to be stored in JPEG file. I'm sure, a bug report have been open in the past and i have fixed this one (0.9.0 release if i remember)
Why iptc preview is depreciate with JPEG. Because this iptc tag size can be set to 256Kb and a JPEG section is just limited to 64Kb. If you try to do it, JPEG file contents become invalid. Also, Exiv2 will not record preview iptc tag if content is too large to be stored in JPEG. In all case, digiKam witch use Exiv2 will never record preview in JPEG file...
Gilles
Gilles, You are right that the bug is fixed, in the sense that the JPEG metadata is not being corrupted. The problem is that when that happens, the whole metadata saving process is aborted, leaving the file without any metadata. Ideally, only the IPTC preview should be skipped IMHO. But in order to do it, the exiv2 lib would have to be changed. Currently if the preview is too big, the Exiv2::JpegBase::doWriteMetadata() function throws an exception and doesn't continue. I think nothing can be done here on the side of digiKam, because even at the lowest level, all metadata is written in one Exiv2 call (from KExiv2Iface::KExiv2::save()) and once that call throws, we end up with nothing. Paweł Created attachment 22113 [details]
Retry saving metadata without IPTC if the first attempt fails
Attached is a patch to libkexiv2 that saves metadata without IPTC in case of a
throw from exiv2. It is not a real fix, so let it just stay here until exiv2 is
fixed, in case someone needs to save jpgs from pngs.
Pawel, Thanks to point me over this problem... but libkexiv2 is not the right place to fix it. The bug is in editor... Look at this file: http://websvn.kde.org/branches/extragear/kde3/graphics/digikam/utilities/imageeditor/canvas/dimginterface.cpp?revision=709454&view=markup .. over lines 598. Do you seen the bug... (:=)))) Gilles SVN commit 738683 by cgilles: digiKam from KDE3 branch: force to remove IPTC preview tags from IPTC metadata if target file is JPEG. CCBUGS: 150801 M +11 -1 dimginterface.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=738683 SVN commit 738685 by cgilles: backport commits #738683 from KDE3 branch BUG: 150801 M +14 -6 dimginterface.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=738685 |