2005.03.05 18:10 "[Tiff] Bogus StripByteCounts field", by Bob Friesenhahn

2005.03.05 19:45 "Re: [Tiff] Bogus StripByteCounts field", by Bob Friesenhahn

You might look into TIFFWriteCheck(). I call it like this but I think it is only needed when I haven't even started writing any imagery yet.

        TIFFWriteCheck( hTIFF, TIFFIsTiled(hTIFF), "GTiffDataset::Crystalize");

It seems that TIFFWriteCheck() is called for free as the first step of TIFFWriteScanline:

#define WRITECHECKSTRIPS(tif, module)                           \
         (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module))

TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t
         static const char module[] = "TIFFWriteScanline";
         register TIFFDirectory *td;
         int status, imagegrew = 0;
         tstrip_t strip;

         if (!WRITECHECKSTRIPS(tif, module))
                 return (-1);

Of course the data is compressed so it may be that not everything is known until the last scanline is written.


Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/