[Digikam-devel] KDE/kdegraphics/libs/libkexiv2/libkexiv2

Gilles Caulier caulier.gilles at gmail.com
Thu Jun 26 16:30:15 BST 2008


SVN commit 824710 by cgilles:

libkexiv2 from trunk : add special case to handle TIFF writting mode properly. we need to load taget TIFF image metadata before to update it, else the image will be broken. look my comments on source code for details.
Hurra : this is want mean than TIFF metadata can be updated on the fly, like JPEG, without to touch image data.
CCMAIL: digikam-devel at kde.org


 M  +7 -0      kexiv2.cpp  


--- trunk/KDE/kdegraphics/libs/libkexiv2/libkexiv2/kexiv2.cpp #824709:824710
@@ -221,6 +221,13 @@
         Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((const char*)
                                       (QFile::encodeName(filePath)));
 
+        // Special case with TIFF format: like all tiff file structure is based on Exif, we
+        // need to read all metadata from original file before to update all. Exiv2 will merge 
+        // old and new data.
+        QString ext = finfo.suffix().toUpper();
+        if (ext == QString("TIF") || ext == QString("TIFF") || ext == QString("DNG"))
+            image->readMetadata();
+
         // Image Comments ---------------------------------
 
         mode = image->checkMode(Exiv2::mdComment);



More information about the Digikam-devel mailing list