2005.02.11 05:37 "[Tiff] facing problems with writing compressed tiff image strips.", by Priyanshu Sharma

2005.02.14 10:53 "Re: [Tiff] make the libtiff library compression enabled??", by Joris Van Damme

Priyanshu,

i guess i have not enabled the compression tag while building the libtiff library. can any one tell me how i can do that i.e. what all flags i have to specify under the head EXTRAFLAGS label.

I doubt your problem is related to that. Judging from your previous post, it is more probable that your problem is related to too small a buffer size.

> > buf size i am taking as the StripByteCount for the respective strips.

Yep... When dealing with compressed images, the StripByteCount is usually going to be smaller then the size of the decompressed strip. TIFFXxxEncodedStrip deals with *decompressed* strips. Thus, you have yourself a buffer overflow.

Use TIFFXxxRawStrip if you're feeling adventurous and are confident that compression method and options in source and dest TIFF match. This will enable you to copy the compressed strips, without any decompression and recompression. Or either use something like TIFFStripSize to calculate the uncompressed strip size.

Also, you might come across problems due to blindly copying tags, as opposed to selectively copying them, if that is what you're doing. Make sure your code copies only the tags it understands. If not, you could for instance be copying a tag with a LONG value that actually points to an IFD that you're not copying, for instance, causing major trouble for a subsequent reader that does know and use the value of the tag.

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