AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2000.01.28 15:33 "Libtiff inplace update and overviews", by Frank Warmerdam
2000.01.30 19:34 "libtiff-3.5.4", by Martin Weber
2000.01.31 19:37 "Reading TIFFs in Visual C", by MC MAHON SINEAD
2000.02.01 13:56 "Re: Reading TIFFs in Visual C", by Bruce Cameron

2000.01.28 15:33 "Libtiff inplace update and overviews", by Frank Warmerdam

Folks,

I have checked in some changes to libtiff in support of "inplace update". In particular, the ability to read, and update a TIFF file in place (rather than doing as part of a file copy operation). There are many limitations but I have now successfully done the following after opening a file with an "r+" access mode.

Now I open the file with "r+" mode, create a set of new overview directories (zeroed strip offset arrays) and then read through the file, occationally writing out a strip of data to each of the overviews as it is completed. This involves alot of switching directories during access, and switching between reading and writing on the different directories.

While it is gratifying that I have this working there are a number of issues. The library was not written with this sort of random update in place in mind. There were and are a number of associated problems with different internal buffer semantics between modes. I have tried to employ a light touch in fiddling with the code, but there is some danger that my changes have broken the library for some types of usage.

Furthermore, you can't rewrite strips/tiles that are compressed. The current logic doesn't attempt to move strips/tiles to the end of the file if the new set of compressed data is larger than the reserved space. Therefore, it's use is only appropriate for uncompressed data.

I have also not yet tried reading, and writing within the same directory without rereading the directory (which cleans up some mode dependent state). I don't know whether it would work, though it is clearly desirable.

Is there anyone interested in "inplace" update for TIFF files? I would be happy to have some other folks try out the code, and report problems, preferably before the next official cut of libtiff.

---------------------------------------+--------------------------------------
I set the clouds in motion - turned up | Frank Warmerdam, warmerda@home.com
light and sound - activate the windows | http://members.home.com/warmerda
and watch the world go round - Rush    | Geospatial Programmer for Rent