2007.08.24 21:08 "[Tiff] A few libtiff4 changes", by Frank Warmerdam

2007.10.04 15:05 "Re: [Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Frank Warmerdam

Joris, and others,

I discovered a problem today with GDAL's use of libtiff4. The problem occurs because libtiff decides as it is writing directories whether to write fields like TILEOFFSETs as LONG (4byte) or LONG8 (8byte). However, my code depends on the questionable assumption that I can rewrite a directory after altering (only) the tile/strip offset and size values.


I have decided that my current approach of rewriting the whole directory is too risk-prone (ie. still doesn't work with legitimate pre-existing files) so I'm going to change my code to include custom mechanisms to update the strip/tile offset/size tags "in place" without using the libtiff "write directory" mechanism. Once done, I'll back out the changes I mentioned above.

I'm considering implementing this as a sort of auxilary libtiff function. Something like "TIFFRewriteImageOffsetSize()" that would update the current directory on disk with the "in memory" strip/tile offsets and sizes. This might result in moving the lists to the end of the file if they change in size (ie. shorts become longs, etc). Do others feel this would be a useful function to have available in libtiff?

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGeo, http://osgeo.org