Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-j.b-one.net (mx-j.one.com [91.198.169.57])
	by mail9.b-one.net (Postfix) with ESMTP id 1E9A9400614
	for <info@awaresystems.be>; Tue, 14 Dec 2010 18:58:18 +0100 (CET)
Received: by mx-j.b-one.net (Postfix, from userid 106)
	id 14043F62C6A; Tue, 14 Dec 2010 18:58:18 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-j.b-one.net (Postfix) with ESMTP id 397A1F62C6A for
 <info@awaresystems.be>; Tue, 14 Dec 2010 18:58:17 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id E6F9C1B00A1; Tue, 14 Dec 2010
 12:56:41 -0500 (EST)
Received: from nugate.apago.com (www.apago.com [68.153.151.10]) by
 lists.maptools.org (Postfix) with ESMTPS id D86EA1B00A1 for
 <tiff@lists.maptools.org>; Tue, 14 Dec 2010 12:55:42 -0500 (EST)
Received: from pearl.apago.com  by gate.apago.com
 (8.13.5.20060308/gate/01-06-97) id oBEHteE9009363; Tue, 14 Dec 2010 17:55:40
 GMT
SMTP-Relay: pearl.apago.com
Message-ID: <4D07AF9C.4000506@apago.com>
Date: Tue, 14 Dec 2010 12:55:40 -0500
From: Dwight Kelly <dkelly@apago.com>
Organization: Apago, Inc.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
 rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
To: tiff@lists.maptools.org
References: <mailman.5.1262019602.802.tiff@lists.maptools.org>
In-Reply-To: <mailman.5.1262019602.802.tiff@lists.maptools.org>
Subject: [Tiff] patch to tif_jpeg.c
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
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>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Hello, I would like to submit the following patch to correctly set JPEG 
colorspace. Current code uses JCS_UNKNOWN for input colorspaces other 
than ycbcr. This causes problems with some decoders including Apple iOS 
4.2.1.


Index: tif_jpeg.c
===================================================================
RCS file: /cvs/maptools/cvsroot/libtiff/libtiff/tif_jpeg.c,v
retrieving revision 1.50.2.14
diff -r1.50.2.14 tif_jpeg.c
1361,1362c1361,1369
<             sp->cinfo.c.in_color_space = JCS_UNKNOWN;
<             if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN))
---
 >              if (td->td_photometric == PHOTOMETRIC_MINISWHITE || 
td->td_photometric == PHOTOMETRIC_MINISBLACK)
 >                  sp->cinfo.c.in_color_space = JCS_GRAYSCALE;
 >              else if (td->td_photometric == PHOTOMETRIC_RGB)
 >                  sp->cinfo.c.in_color_space = JCS_RGB;
 >              else if (td->td_photometric == PHOTOMETRIC_SEPARATED && 
td->td_samplesperpixel == 4)
 >                  sp->cinfo.c.in_color_space = JCS_CMYK;
 >              else
 >                  sp->cinfo.c.in_color_space = JCS_UNKNOWN;
 >             if (!TIFFjpeg_set_colorspace(sp, 
(sp->cinfo.c.in_color_space == JCS_RGB) ? JCS_YCbCr : 
sp->cinfo.c.in_color_space))

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