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

2005.02.14 18:08 "Re: [Tiff] make the libtiff library compression enabled??", by Antoine

with reference to the my previous post


i have figured out my problem and now i am able to extract a single page from a tiff file but it works only for the uncompressed images.

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 pulled my hair out for ages trying to do some similar stuff with libtiff and just ended up doing a straight copy. If you can get your data into a single strip (with libtiff or other) then the code is very simple indeed. You just read the stripoffset tag and stripbytecounts and read from the file into a buffer and write out to the new file (making sure you put in stripbytecounts and your desired stripoffset). You could also copy each strip over but that gets more complicated. You need to make sure you know the format though, cos as someone else mentions, if you miss copying an important tag you can have very subtle errors creep in. My c is very weak and for this sort of control it was much simpler to do it myself.

Make sure you read the very readable standard (google for tiff6.pdf) thoroughly a few times first and during and you'll be fine.