Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
X-Original-To: filtered@awaresystems.be
Delivered-To: filtered@awaresystems.be
Received: from mx-q.one.com (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id 2978A40063F
	for <filtered@awaresystems.be>; Fri, 27 Apr 2012 21:09:19 +0200 (CEST)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-q: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.210.41 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-pz0-f41.google.com (mail-pz0-f41.google.com [209.85.210.41])
	by mx-q.one.com (Postfix) with ESMTP id A142786562A
	for <filtered@awaresystems.be>; Fri, 27 Apr 2012 19:09:18 +0000 (UTC)
Received: by dajx4 with SMTP id x4so1615262daj.0
        for <filtered@awaresystems.be>; Fri, 27 Apr 2012 12:09:17 -0700 (PDT)
Received: by 10.68.220.161 with SMTP id px1mr25624615pbc.12.1335553757271;
        Fri, 27 Apr 2012 12:09:17 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.142.164.16 with SMTP id m16csp329020wfe;
        Fri, 27 Apr 2012 12:09:16 -0700 (PDT)
Received: by 10.68.190.69 with SMTP id go5mr25491256pbc.98.1335553754924;
        Fri, 27 Apr 2012 12:09:14 -0700 (PDT)
Received-SPF: softfail (google.com: best guess record for domain of transitioning tiff-bounces@lists.maptools.org does not designate 91.198.169.57 as permitted sender) client-ip=91.198.169.57;
Received: by 10.68.141.130 with POP3 id ro2mf550327pbb.1;
        Fri, 27 Apr 2012 12:09:14 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-j.one.com (mx-j.one.com [91.198.169.57])
	by mail9.b-one.net (Postfix) with ESMTP id 0C86F40063F
	for <info@awaresystems.be>; Fri, 27 Apr 2012 20:59:25 +0200 (CEST)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-j.one.com (Postfix) with ESMTP id A0DD3714543
	for <info@awaresystems.be>; Fri, 27 Apr 2012 18:59:24 +0000 (UTC)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 4AF5C1EDAF3;
	Fri, 27 Apr 2012 13:58:11 -0500 (EST)
Received: from smtp2.mathworks.com (smtp2.mathworks.com [144.212.95.218])
	by lists.maptools.org (Postfix) with ESMTP id 349441EDAF3
	for <tiff@lists.maptools.org>; Fri, 27 Apr 2012 13:57:34 -0500 (EST)
Received: from mail-vif.mathworks.com (newscl02ah.mathworks.com
	[144.212.95.122])
	by smtp2.mathworks.com (8.13.8/8.12.11) with ESMTP id q3RIvX6i005896
	for <tiff@lists.maptools.org>; Fri, 27 Apr 2012 14:57:33 -0400 (EDT)
Received: from johne-deb6-64.localnet (johne-deb6-64.dhcp.mathworks.com
	[172.31.56.56])
	by mail-vif.mathworks.com (8.13.8/8.13.8) with ESMTP id q3RIvXpL014534
	for <tiff@lists.maptools.org>; Fri, 27 Apr 2012 14:57:33 -0400 (EDT)
From: John Evans <john.evans@mathworks.com>
To: tiff@lists.maptools.org
Date: Fri, 27 Apr 2012 14:57:33 -0400
User-Agent: KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; )
References: <201204241226.21606.john.evans@mathworks.com>
	<BLU165-W53700443AC04C078E6F33E1250@phx.gbl>
	<CA+NZCsRwF5KMv5kVsGG+Efh1sCZPDhABAuDVgDWEE+Kzc=tOhQ@mail.gmail.com>
In-Reply-To: <CA+NZCsRwF5KMv5kVsGG+Efh1sCZPDhABAuDVgDWEE+Kzc=tOhQ@mail.gmail.com>
MIME-Version: 1.0
Message-Id: <201204271457.33301.john.evans@mathworks.com>
Subject: Re: [Tiff] YCbCr/JPEG issue in 4.0.1
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

Here's one more twist on this issue.  I created a variant of quad-tile.tif to 
use jpeg compression instead, and the YCbCr subsampling coefficients are 
definitely there, as verified by tiffdump

Example file at http://mexcdf.sourceforge.net/quad-tile.jpg.tif

<snip>
ImageWidth (256) SHORT (3) 1<512>
ImageLength (257) SHORT (3) 1<384>
BitsPerSample (258) SHORT (3) 3<8 8 8>
Compression (259) SHORT (3) 1<7>
Photometric (262) SHORT (3) 1<6>
SamplesPerPixel (277) SHORT (3) 1<3>
PlanarConfig (284) SHORT (3) 1<1>
TileWidth (322) SHORT (3) 1<128>
TileLength (323) SHORT (3) 1<128>
TileOffsets (324) LONG (4) 12<8 1758 3804 6087 8087 9790 11721 13956 16170 
18127 20290 22772>
TileByteCounts (325) LONG (4) 12<1750 2046 2283 2000 1703 1931 2235 2214 1957 
2163 2482 1912>
SampleFormat (339) SHORT (3) 3<1 1 1>
JPEGTables (347) UNDEFINED (7) 574<0xff 0xd8 0xff 0xdb 00 0x43 00 0x8 0x6 0x6 
0x7 0x6 0x5 0x8 0x7 0x7 0x7 0x9 0x9 0x8 0xa 0xc 0x14 0xd ...>
YCbCrSubsampling (530) SHORT (3) 2<2 2>
</snip>

The file can be found at http://mexcdf.sourceforge.net/quad-tile.jpg.tif

As reported before, the RGBA interface reads the TIFF just fine (on both 3.9.5 
and 4.0.1), but TIFFReadEncodedTile reports different results on 3.9.5 and 
4.0.1.  The first three YCbCr "clumps" running down the left hand side of the 
tile as reported by 3.9.5 are as follows (sorry for any bad spacing)

    clump  0:   0   0    2  0  138  139
    clump 32:  0   0    9  6  134  119
    clump 64: 44 40 63 59 230    95

but 4.0.1 reports

    clump  0:   0   0    2  0  138  139
    clump 32:  0   0    0  0      0      0
    clump 64:  0   0    9  6   134  119

and one can see the effect when the tile is visualized, that two rows of zeros 
are interspersed amonst each two valid rows of luminence pixels, and that a 
row of zeros is interspersed in between the valid rows of chrominence pixels.  

The last thing is that a 4.0.1 client reports the "JPEGDecodeRaw: application 
buffer not large enough for all data" warning during the call to 
TIFFReadEncodedTile and returns a -1.  A 3.9.5 client reports all ok, though.

If no objections, I'll file a bug report?



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