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
November 2008

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

2008.11.18 02:14 "Creating a tiled tiff from scratch (essentially)", by Tucker A Beck
2008.11.18 04:04 "Re: Creating a tiled tiff from scratch (essentially)", by Frank Warmerdam
2008.11.18 09:28 "Re: Creating a tiled tiff from scratch (essentially)", by <jcupitt@gmail.com>

2008.11.18 04:04 "Re: Creating a tiled tiff from scratch (essentially)", by Frank Warmerdam

Beck, Tucker A wrote:
> I am using libtiff in an image processing application.  The input images are
> tiled, multi-image, JPEG compressed tiff files.  I have had great success in
> opening, converting, and processing the image data using libtiff.  Now, I
> need to be able to store the results of processing in a new tiff file.  I
> have encountered a few problems along the way.
> 
> When I create the tiff file, I would like to set up each directory when I
> create the file.  I do not want to store any image data in them at creation,
> I just want them to be ready for writing data when it needs to be done.
> There are somewhere between 3 and 7 directories that I need to make.  It
> seems like the only way to do this is to set all the fields for the
> directory, write a single dummy tile (using TIFFWriteTile) and then write
> the directory (TIFFWriteDirectory).  This seems like an ugly way to do
> things; I'd rather not have to write any data until absolutely necessary.
> If I try to write the directory without having written a tile, I get a
> message that says, "MissingRequired: lib/op.svs: TIFF directory is missing
> required "TileOffsets" field."  Is there any way to set up the directory
> with all the fields correctly assigned, but no data yet written?

Tucker,

Try calling TIFFWriteCheck() before calling TIFFWriteDirectory().  It sets the
"been writing" flag which appears to be necessary.

like:

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

Note that you will produce a TIFF file with zeros for all the tile offsets.
Many applications will choke badly on such a file.  So be cautious about
letting these files go into the wild in this state.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent