2007.10.04 18:47 "[Tiff] Pink pages with tiff2pdf -j", by Chris Gentle

2007.10.04 21:40 "RE: [Tiff] Pink pages with tiff2pdf -j", by Ed Grissom

Just a bit more info:

I was able to edit the pdf and get it to look right (remove the pink and green).

All I had to do was to remove the text "/DecodeParms << /ColorTransform 0 >>" from just before the JPEG data.

Looking at (an old version of) the tiff2pdf code, I had found near line 4989:

                case T2P_COMPRESS_JPEG:
                        written += TIFFWriteFile(output, (tdata_t)
"/DCTDecode ", 11);

                        if(t2p->tiff_photometric != PHOTOMETRIC_YCBCR) {
                                written += TIFFWriteFile(output,
(tdata_t) "/DecodeParms ", 13);
                                written += TIFFWriteFile(output,
(tdata_t) "<< /ColorTransform 0 >>\r", 24);

But, even if the input is RGB, it is creating YCbCr data (the JPEG data is YCbCr), so it does not matter what the input Photometric is, it should not write those lines.

ed grissom

-----Original Message-----

From: tiff-bounces@lists.maptools.org [mailto:tiff-bounces@lists.maptools.org] On Behalf Of Frank Warmerdam

The tiff2pdf "-j" option creates JPEG data inside the PDF.

Mistaking RGB for YCbCr or vice-versa in JPEG compression typically shows up as pink and green images (which is what we are seeing here).

Does this ping anyone's memory about recent changes?

tiff2pdf.c has seen quite a few fixes in the last couple years. It is likely this is already fixed. The following looks most promising out of the cvs log:

revision 1.40

date: 2007/07/03 15:47:05;  author: dron;  state: Exp;  lines: +523 -510

Fix for TIFFTAG_JPEGTABLES tag fetching and significant upgrade of the whole utility as per bug http://bugzilla.remotesensing.org/show_bug.cgi?id=1560 Now we don't need tiffiop.h in tiff2pdf anymore and will open output PDF file using TIFFClientOpen() machinery as it is implemented by Leon Bottou.

The last few years logs look like:

[deleted edg]

Best regards,


and watch the world go round - Rush    | President OSGeo, http://osgeo.org