Received: from mailgate004.isp.belgacom.be (mailgate004.isp.belgacom.be [195.238.6.89])
	by maildelivery001.isp.belgacom.be (Postfix) with ESMTP id 8184A5A801E
	for <joris.at.lebbeke@skynet.be>; Thu,  4 Oct 2007 23:47:49 +0200 (CEST)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 04 Oct 2007 23:47:48 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l94LeOLp002064;
	Thu, 4 Oct 2007 17:40:38 -0400
Received: from us-smtp2.ingrnet.com (ckpnt05.intergraph.com [63.75.137.244])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l94LeLkQ002061
	for <tiff@lists.maptools.org>; Thu, 4 Oct 2007 17:40:22 -0400
Received: from US-MAIL.ingrnet.com ([129.135.112.2]) by us-smtp2.ingrnet.com
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Thu, 4 Oct 2007 16:40:21 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: [Tiff] Pink pages with tiff2pdf -j
Date: Thu, 4 Oct 2007 16:40:25 -0500
Message-ID: <AA6DDFA4E046A24585BC828A78155B4702929E77@US-MAIL.ingrnet.com>
In-Reply-To: <47055C68.8000000@pobox.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] Pink pages with tiff2pdf -j
Thread-Index: AcgGzi//gS6lt7QnTp6SF2syh9cqAAAAEngA
References: <20071004184731.GA13108@zippy.hiwaay.net><Pine.SOC.4.64.0710041400490.7786@freddy><AA6DDFA4E046A24585BC828A78155B4702929E06@US-MAIL.ingrnet.com>
	<47055C68.8000000@pobox.com>
From: "Grissom, Ed" <ed.grissom@intergraph.com>
To: "Frank Warmerdam" <warmerdam@pobox.com>, <tiff@lists.maptools.org>
X-OriginalArrivalTime: 04 Oct 2007 21:40:21.0503 (UTC)
	FILETIME=[2A2390F0:01C806CF]
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	l94LeLkQ002061
Cc: 
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
Content-Transfer-Encoding: quoted-printable
X-UIDL: 000000000023ceae.00002823
X-MSP-STORE: Thu, 04 Oct 2007 23:47:49 +0200
Status:   


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 +=3D TIFFWriteFile(output, (tdata_t)
"/DCTDecode ", 11);

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

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.=20




--=20
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.=20
>=20
> 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).=20
> =20
> Does this ping anyone's memory about recent changes ?  =20

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=3D1560
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,
--=20
---------------------------------------+--------------------------------
------
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

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
