home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / graphics / tiff / unix / archive.z / archive / text0020.txt < prev    next >
Encoding:
Text File  |  1995-09-20  |  1.4 KB  |  36 lines

  1. Hi,
  2.  I'm trying to append some images to an existing TIFF file that already has
  3. an image in it. I'm not having much sucess doing this. Here is the sequence
  4. of calls I'm making:
  5.     tiff = TIFFFOpen(filename, "r+"); //I've also tried "a" without success
  6.         TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, xsize);
  7.         TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, ysize);
  8.     TIFFSetField(tiff, TIFFTAG_IMAGEDEPTH, 1);
  9.     TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, bpp);
  10.     TIFFSetField(tiff, TIFFTAG_SAMPLEFORMAT, ttype);
  11.     TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
  12.     TIFFSetField(tiff, TIFFTAG_ORIENTATION,ORIENTATION_TOPLEFT);
  13.     TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, csize);
  14.     TIFFSetField(tiff, TIFFTAG_TILEWIDTH, xPageSize);
  15.     TIFFSetField(tiff, TIFFTAG_TILELENGTH, yPageSize);
  16.     TIFFSetField(tiff, TIFFTAG_TILEDEPTH, 1);
  17.     TIFFWriteDirectory(tiff);
  18.     TIFFSetDirectory(tiff, 1); //this always fails and I get the message :
  19.                                    //"Could not index into TIFF directory"
  20.     While(..there are tiles to write..)
  21.         TIFFWriteEncodedTile (tiff, tile, bufdata, bytecount);
  22.  
  23. Even if I take out the TIFFSetDirectory() call, what happens is that the
  24. existing file has been corrupted and can't be read at all.
  25. Anyone successfully appended images ? The README file says that the append
  26. mode hasn't been tested.
  27. Any help is welcome.
  28. -venky
  29.  
  30. -- 
  31. ---
  32. Venkatesh Narayanan        Silicon Graphics, Inc.            
  33. AGD/Image Processing    (415) 390-5314    venky@sgi.com 
  34.  
  35.  
  36.