2004.03.03 11:16 "Re: [Tiff] Hello world", by Gerben Vos
My problem is that when I'm working on a big TIFF file ( tile based ) I want to read and write simultaneous to the same file, to change small portions of my bigImage.
I have never tried it, but I guess it should be possible to open the TIFF as a normal file (using open() on Unix or CreateFile() on Win32; see the code in tif_unix.c, tif_win32.c, or the appropriate file for your OS), and then pass the returned file descriptor to TIFFFdOpen(). Then you can use libtiff to read the strip offsets and sizes, and use the normal file handle to lseek() (or SetFilePointer() or whatever) to the correct offset within the file and overwrite the data there. I'm not sure whether it would be wise to use any of libtiff's write functions.
Of course, this will all only work when the TIFF is uncompressed! Otherwise, the (compressed) size of the data could change, and all bets are off.
It would be interesting to hear from anyone who has ever tried this kind of thing with libtiff.