[Digikam-devel] extragear/graphics/digikam/libs/dimg/loaders

Gilles Caulier caulier.gilles at free.fr
Mon May 29 15:18:57 BST 2006


SVN commit 546226 by cgilles:

digikam from trunk : DImg::TIffLoader : optimize again Deflate compression ratio like gimp tiff coder done.
The Predictor tiff tag must be set to '2' for the best results. Look below :

#ls -l _*
-rw-------  1 gilles gilles 11523474 mai 29 16:17 _dsc0034 (deflate alone).tif
-rw-------  1 gilles gilles  7553642 mai 29 16:14 _dsc0034 (deflate + horizontal predictor).tif
-rw-------  1 gilles gilles 18253872 mai 29 16:17 _dsc0034 (without compression).tif
-rw-r--r--  1 gilles gilles  1750127 mar 24 15:18 _dsc0034.jpg
-rw-r--r--  1 gilles gilles 10471516 mar 24 15:18 _dsc0034.png

_dsc0034.jpg is the original file loaded in editor and saved like tiff files following different settings.

For more details about predictor values, look here :http://www.awaresystems.be/imaging/tiff/tifftags/predictor.html

Note : the implementation is compatible with libtiff 3.6.x and 3.8.x

BUG:125779
CCMAIL: digikam-devel at kde.org

 M  +4 -0      tiffloader.cpp  


--- trunk/extragear/graphics/digikam/libs/dimg/loaders/tiffloader.cpp #546225:546226
@@ -399,6 +399,10 @@
     {
         TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_ADOBE_DEFLATE);
         TIFFSetField(tif, TIFFTAG_ZIPQUALITY,  9);
+        // NOTE : this tag values aren't defined in libtiff 3.6.1. '2' is PREDICTOR_HORIZONTAL.
+        //        This value is used to optimize Deflate compression ratio. See this url for more details:
+        //        http://www.awaresystems.be/imaging/tiff/tifftags/predictor.html
+        TIFFSetField(tif, TIFFTAG_PREDICTOR,   2); 
     }
     else
         TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE);



More information about the Digikam-devel mailing list