AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.03.01 20:10 "[Tiff] Hello world", by xevit
2004.03.01 22:10 "Re: [Tiff] Hello world", by Chris Cox
2004.03.02 23:14 "Re: [Tiff] Hello world", by xevit
2004.03.02 23:16 "RE: [Tiff] Hello world", by Pushkar Pradhan
2004.03.03 11:16 "Re: [Tiff] Hello world", by Gerben Vos
2004.03.03 12:02 "Re: [Tiff] Hello world", by Rob van den Tillaart
2004.03.02 23:13 "[Tiff] Splines To Tiles", by xevit
2004.03.03 12:37 "Re: [Tiff] Splines To Tiles", by Gerben Vos
2004.03.03 13:03 "Re: [Tiff] Splines To Tiles", by Frederic Delhoume
2004.03.03 14:18 "Re: [Tiff] Hello world", by Frank Warmerdam
2004.03.13 17:11 "[Tiff] Error handling in LibTiff", by xevit

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.

                                        Gerben Vos.