AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 1994

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

1994.12.02 20:30 "Appending images to an existing file", by Venkatesh Narayanan
1994.12.02 21:40 "Re: Appending images to an existing file", by Sam Leffler

1994.12.02 20:30 "Appending images to an existing file", by Venkatesh Narayanan

Hi,
 I'm trying to append some images to an existing TIFF file that already has
an image in it. I'm not having much sucess doing this. Here is the sequence
of calls I'm making:
	tiff = TIFFFOpen(filename, "r+"); //I've also tried "a" without success
        TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, xsize);
        TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, ysize);
	TIFFSetField(tiff, TIFFTAG_IMAGEDEPTH, 1);
	TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, bpp);
	TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, ttype);
	TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
	TIFFSetField(tiff, TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
	TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, csize);
	TIFFSetField(tiff, TIFFTAG_TILEWIDTH, xPageSize);
	TIFFSetField(tiff, TIFFTAG_TILELENGTH, yPageSize);
	TIFFSetField(tiff, TIFFTAG_TILEDEPTH, 1);
	TIFFWriteDirectory(tiff);
	TIFFSetDirectory(tiff, 1); //this always fails and I get the message :
                                   //"Could not index into TIFF directory"
	While(..there are tiles to write..)
		TIFFWriteEncodedTile (tiff, tile, bufdata, bytecount);

Even if I take out the TIFFSetDirectory() call, what happens is that the
existing file has been corrupted and can't be read at all.
Anyone successfully appended images ? The README file says that the append
mode hasn't been tested.
Any help is welcome.
-venky

-- 
---
Venkatesh Narayanan	    Silicon Graphics, Inc.		    
AGD/Image Processing    (415) 390-5314	venky@sgi.com