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 2CD8B400363
	for <info@awaresystems.be>; Sat,  1 Jan 2011 15:02:28 +0100 (CET)
Received: by mx-j.b-one.net (Postfix, from userid 106)
	id 23DA2214B7D; Sat,  1 Jan 2011 15:02:28 +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 6AC5A214B7D for
 <info@awaresystems.be>; Sat,  1 Jan 2011 15:02:27 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 409731B00A2; Sat,  1 Jan 2011
 09:01:24 -0500 (EST)
Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by
 lists.maptools.org (Postfix) with ESMTP id 668A41B0076 for
 <tiff@lists.maptools.org>; Sat,  1 Jan 2011 08:53:44 -0500 (EST)
Received: from even-desktop.localnet (unknown [88.162.84.61]) by
 smtp6-g21.free.fr (Postfix) with ESMTP id 47C2E82243; Sat,  1 Jan 2011
 14:53:39 +0100 (CET)
From: Even Rouault <even.rouault@mines-paris.org>
To: tiff@lists.maptools.org
Date: Sat, 1 Jan 2011 14:53:42 +0100
User-Agent: KMail/1.13.2 (Linux/2.6.32-27-generic; KDE/4.4.2; x86_64; ; )
References: <201101011441.00281.even.rouault@mines-paris.org>
In-Reply-To: <201101011441.00281.even.rouault@mines-paris.org>
MIME-Version: 1.0
Message-Id: <201101011453.42845.even.rouault@mines-paris.org>
Subject: Re: [Tiff] Regression in libtiff 4.0 CVS when creating a JPEG RGB
 contig
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

Hum, and there's also another case that doesn't work.

If I have a 2 band image as source :

$ ./tools/tiffcp 2band.tif out.tif -c jpeg -p contig
JPEGLib: Bogus input colorspace.
out.tif: Error, can't write strip 0.

So, I'd also suggest changing :

	if (td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric == 
PHOTOMETRIC_MINISBLACK)
		sp->cinfo.c.in_color_space = JCS_GRAYSCALE;

into :

	if ((td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric 
== PHOTOMETRIC_MINISBLACK) && td->td_samplesperpixel == 1)
		sp->cinfo.c.in_color_space = JCS_GRAYSCALE;
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
