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
April 2005

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

2005.04.06 12:19 "PB with TIFFWriteScanline, writing after data", by <samuel@studiofx.fr>
2005.04.06 12:53 "Re: PB with TIFFWriteScanline, writing after data", by Joris Van Damme

2005.04.06 12:53 "Re: PB with TIFFWriteScanline, writing after data", by Joris Van Damme

Samual,

> But then when a want to alter one row by calling TIFFWriteScanline again,
> raster data are written after the existing raster data and before the ending
> directory (the different tags). So it doesn't overwrite the row I want to!
>
> Is it normal?

Yes, that is normal. LibTiff does not support 'overwriting' existing already
written raster data in this way. It would not be feasible, given the fact that
the data can be compressed. You can use more complicated schemes to 'delete' a
complete page in a TIFF file, and append another in its place, but then, TIFF
does not have any kind of 'memory management' inside the file, deallocation of
data blocks as such for subsequent reuse is not feasible, and thus your file
will get larger every time...

In the end, the proper way to go is to make sure you know what you need to
write, before writing it, instead of overwriting it afterwards.

If you don't compress, there might actually be a way to nevertheless do this
'overwriting' bit. You could write the $FF stuff like you do, and next look at
the strip offset values. You could then write to these offsets directly, calling
the writer procedure without passing through core LibTiff... I don't even know
if LibTiff offers direct access to these offsets, though, from the top of my
head, as opposed to providing full access to the actual strips.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html