2006.01.03 13:01 "[Tiff] read all uncompressed tiff data", by Rocky Pulley

2006.01.03 17:12 "Re: [Tiff] read all uncompressed tiff data", by Joris Van Damme

I'm writing a PDF converter and I need to get the TIFF data in one uncompressed chunk to put in the file. Is it possible to somehow say:

unsigned char *data;
int size;

TIFFGetImageData(myTiff, &data, &size);

PDF supports most compression modes that TIFF does. Thus, doing a TIFF to PDF conversion, it is customary to not even decompress, but to snoop the compressed image data from the TIFF and directly dump that into the PDF. For lossy compression, like JPEG, that's not just a performance issue, but also a size and quality issue.

For this purpose, you can use the TIFFReadRaw interface after reading/detecting configuration from tags:



I am hoping that I don't have to do anything based on the RGB info or compression level, I'm just wanting some way to get the image data of the tiff. I will need to use this metadata when writing info about the image to the file, but I'm sort of hoping that I can just get the image data in an easy call.

You seem to be asking for the RGBA interface.


But consider what I wrote above. Also, there's a tiff2pdf contribution in the LibTiff distribution that you may find helpful.

Joris Van Damme
Download your free TIFF tag viewer for windows here: