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
October 2007

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

2007.10.04 18:47 "Pink pages with tiff2pdf -j", by Chris Gentle
2007.10.04 19:14 "Re: Pink pages with tiff2pdf -j", by Bob Friesenhahn
2007.10.04 20:33 "Re: Pink pages with tiff2pdf -j", by Ed Grissom
2007.10.04 21:34 "Re: Pink pages with tiff2pdf -j", by Frank Warmerdam
2007.10.04 21:40 "Re: Pink pages with tiff2pdf -j", by Ed Grissom
2007.10.05 20:22 "Re: Pink pages with tiff2pdf -j", by Chris Gentle

2007.10.04 21:40 "Re: 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:


#ifdef JPEG_SUPPORT
		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);
			}
			break;
#endif
 

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
ed.grissom@intergraph.com




-----Original Message-----
From: tiff-bounces@lists.maptools.org
[mailto:tiff-bounces@lists.maptools.org] On Behalf Of Frank Warmerdam
Sent: Thursday, October 04, 2007 4:35 PM
To: tiff@lists.maptools.org
Subject: Re: [Tiff] Pink pages with tiff2pdf -j

Grissom, Ed wrote:
> 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 ?   

Folks,

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,
-- 
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo,
http://osgeo.org