Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas021.isp.belgacom.be (localhost [127.0.0.1])
        by inav019.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k93DLImb007257
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Oct 2006 15:21:20 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx015.isp.belgacom.be (inmx015.isp.belgacom.be [195.238.4.218])
        by inas021.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k93DL5MU006275
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Oct 2006 15:21:10 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx015.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id k93DKwwt005215
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Oct 2006 15:20:58 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
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 k93D7oqZ009679;
	Tue, 3 Oct 2006 09:08:10 -0400
Received: from outmx026.isp.belgacom.be (outmx026.isp.belgacom.be
	[195.238.4.91])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k93D7lKl009676
	for <tiff@lists.maptools.org>; Tue, 3 Oct 2006 09:07:47 -0400
Received: from outmx026.isp.belgacom.be (localhost [127.0.0.1])
	by outmx026.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22)
	with ESMTP id k93D7bJ4016568
	for <tiff@lists.maptools.org>; Tue, 3 Oct 2006 15:07:37 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (93.193-64-87.adsl-dyn.isp.belgacom.be
	[87.64.193.93])
	by outmx026.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22)
	with SMTP id k93D7Vr4016479; Tue, 3 Oct 2006 15:07:32 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <001f01c6e6ed$32569310$5dc14057@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Jean-Yves Le Ridant" <jean-yves.leridant@culture.gouv.fr>,
        <tiff@lists.maptools.org>
References: <56459261.20061003141632@culture.gouv.fr>
Subject: Re: [Tiff] Status of ISO JBIG and CIELAB JPEG support
Date: Tue, 3 Oct 2006 15:09:43 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807
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
X-UIDL: 000000000023ceae.00001b59
X-MSP-STORE: Tue, 03 Oct 2006 15:21:28 +0200
Status:   

Jean-Yves,

Jean-Yves Le Ridant wrote:
> I agree and its for parts a result, when trying to add some general
> support for lab/jpeg/tiff files, of dealing with specs, some "state of
> art" of libtiff 3.7.3 ( don't know if things have changed ), tifftools
> ( mainly  tiffcp ), photoshop, and ... my own user's requests.
> ;-)

I think we've some communication problems going on... Let me again
attempt to be clear on one thing at least: most of these files are
perfectly OK. In fact, it's a surprise to see such good work and eye for
detail in an area where the producer of the files needs to put a lot of
specs and tools together, and that still is vague to some degree (as for
example when Subsampling mixes with Lab - some people say that
Subsampling simply doesn't apply to Lab, but then there's RFC 2301
(IIRC) saying otherwise, some other people have written ITULab files
with Subsampling and we need to be able to at least read these... So you
can't escape reality with an easy decision, this is a mess no matter
what).

> For what I remember, ( I have done this job in 06/2005), a problem
> for example, rely on default 2,2 subsampling ( when you enter "wide
> view" of subsampling).
> NB : photoshop handle jpeg/cielab ( with progressive in jpegtiff ?)
> and when saving an uncompressed cielab file, do not write a
> subsampling tag 1,1 ...

As far as this problem is concerned, the way my decoder handles this is
the following:

- if colorspace is YCbCr
    - if Subsampling tag is not present
        -> assume TIFF 6.0 default [2,2] applies
    - else
        -> assume Subsampling tag is correct
- else if colorspace is CIE, ICC or ITU Lab
    - if Subsampling tag is not present
        -> assume writer thinks subsampling doesn't apply, i.e. assume
[1,1]
    - else
        -> assume writer thinks subsampling applies, i.e. that this tag
is correct
- else
    -> assume no subsampling, regardless of tag presence

Next, if compression scheme can support deriving Subsampled values from
the compressed data, as does for instance JPEG and OJPEG compression, I
allow this to correct the values. This last bit is expense, well, not
really, but it's expensive overhead compared to the simple reading of a
tag anyway. The good news is that it's not really that necessary, above
scheme without this last bit will yield correct values (as in writer
intention that corresponds to the actual data in there) 99% of the time.
With this last bit in place, I arrive at something like 99.9%. (All
percentage are a figure of speech to give you some idea - I'm not able
to measure since it's impossible to guarantee any set of testfiles is
representative for the hole of the files out there.)

I've not yet made a definite choice in the encoder, though. So I for one
am hoping someone with authority tries to clean up this confusion in a
proper manner. (For example by allowing encoders to either disregard or
apply subsampling to CIE, ICC, and ITU Lab, at will, by making the
default for this tag be [1,1] as far as these Photometrics is concerned.
Messy to have the default depend on the value of another tag, but it may
very well be the only way out, and it certainly is consistent with the
files out there already.)


Best regards,

Joris

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