AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2014.12.15 17:49 "[Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault
2014.12.15 19:53 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Joris Van Damme
2014.12.15 20:17 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault
2014.12.15 22:09 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Joris Van Damme
2014.12.15 22:49 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault
2014.12.15 23:44 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Joris Van Damme
2014.12.20 22:51 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Bob Friesenhahn
2014.12.20 23:06 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault
2014.12.21 00:30 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Bob Friesenhahn
2014.12.21 02:24 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Tom Lane
2014.12.21 15:08 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Bob Friesenhahn
2014.12.21 15:38 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault

2014.12.15 17:49 "[Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault

Hi,

Just to notify that I've just fixed in libtiff HEAD a regression dating back from 2010 (libtiff 3.9.3 and 4.0.X) that caused JPEG quantization tables to be unnecessarily emitted in each strip/tile, even in the JPEGTABLESMODE_QUANT mode where they are supposed to be only emitted in the global TIFFTAG_JPEGTABLE tag.

Note however that this complicates the case where one updates an existing JPEG-compressed TIFF. One advantage of the previous behaviour is that it made that relatively safe. Now, one must properly set the JPEG quality to be the one used when generating TIFFTAG_JPEGTABLE. I've implemented in GDAL the logic to retrieve the quality fom the JPEGTABLE (quite ugly: by iterating from 1 to 100 until the computed table and serialized tables match), and if no match (shouldn't happen if the file has been created with libtiff), I go in TIFFTAG_JPEGTABLESMODE = 0 mode where tables will be emitted for each tile/strip. Probably this should be done in libtiff itself, when one detects a switch between TIFF directories (or at the first write in a directory), and by using the libjpeg decompressor so as to retrive the tables directly, without needing the quality value, but this didn't really seem straightforward to do in libtiff the compressor and decompressor structures being exclusive. Hum...

So, hopefully the new situation is better in the nominal case where one just create a JPEG-compressed file without updating it, by going back to the libtiff 3.8.X behaviour. And in the update scenarios, one must be careful of setting TIFFTAG_JPEGQUALITY to the right value.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com