2014.12.15 17:49 "[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



> Well, I think the intent of TIFFTAG_JPEGTABLESMODE = 3 (the default mode) is > to avoid writing quantization&huffman tables in tiles/strips when it is not

> necessary. And more generally achieving the smallest binary size seems to be a > reasonable objective.


Of course, the whole scheme (nearly) dates back to times when recommended strip/tile data size was 8 kilobyte uncompressed. These days, I'd say a recommended size for a strip or tile is several orders of magnitude larger, maybe around a megabyte or such, uncompressed, so maybe something like 100 kilobyte JPEG compressed with reasonably low quality and 2,2 subsampling. So you'd have to weigh the size of the tables against that. I figure the average size of the tables is about half a kilobyte.

Still, absolutely some people/files still lean towards having strip/tile sizes a bit smaller, maybe quite a bit smaller. And even if they are not, achieving smallest binary size is absolutely a reasonable objective, and so is any attempt to stop duplication of the same data, as a matter of principle. In that light, maybe my "not significant" comment is not all that correct. Of course, the context of that comment was merely a secondary bullet point in a decision I made inside a library that defaults to strip/tile sizes of about a megabyte uncompressed.

> perhaps it does, just haven't a test example
> handy

> I'm not saying doing something better is impossible, it is just that I don't > feel pursuing that right now ;-) Trivial changes in that code have a high

> chance of causing issues in some cases, so non-trivial changes, and especially > since I don't think the test suite actually tests that a lot.


If at any point in the future testfiles with any particular variations on these schemes are required, I can easily generate those, and we'd have the added benefit of crosstesting.

Best regards,