Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-d.b-one.net (mx-d.one.com [91.198.169.51])
	by mail9.b-one.net (Postfix) with ESMTP id 8A79B400164
	for <info@awaresystems.be>; Mon, 30 Nov 2009 06:13:16 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 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-d.b-one.net (Postfix) with ESMTP id B1B0532B
	for <info@awaresystems.be>; Mon, 30 Nov 2009 06:13:15 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 762211D202896;
	Mon, 30 Nov 2009 00:12:10 -0500 (EST)
Received: from mail.howardsilvan.com (216-235-106-HCC-115.hcc.net
	[216.235.106.115])
	by lists.maptools.org (Postfix) with ESMTPS id 9FC6F1D201CBE
	for <tiff@lists.maptools.org>; Mon, 30 Nov 2009 00:05:59 -0500 (EST)
Received: from fangorn.howardsilvan.com (localhost [127.0.0.1])
	by mail.howardsilvan.com (Postfix) with ESMTP id 22B46C4200F
	for <tiff@lists.maptools.org>; Sun, 29 Nov 2009 21:05:50 -0800 (PST)
Received: from bilbo.x101.com ([64.146.212.27] helo=bilbo.x101.com) with
	IPv4:25 by fangorn.howardsilvan.com; 29 Nov 2009 21:05:49 -0800
Message-ID: <4B1352B6.4000504@howardsilvan.com>
Date: Sun, 29 Nov 2009 21:05:58 -0800
From: Lee Howard <faxguy@howardsilvan.com>
User-Agent: Thunderbird 2.0.0.19 (X11/20090105)
MIME-Version: 1.0
To: TIFF mailing list <tiff@lists.maptools.org>
Subject: [Tiff] TIFFTAG_JPEGTABLES mandatory for JPEG-in-TIFF since 3.8.x ?
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

Attached is a HylaFAX-received color fax... a JPEG wrapped in TIFF...
libtiff used by HylaFAX was 4.0.0beta5.

(Note, attachment was too big for automated approval to the list, so 
I've posted it at http://www.howardsilvan.com/fax000002737.tif.)

With 3.7.4 this worked fine, but something changed between there and
3.8.2 which caused it to stop "working" as expected, and so I've
procrastinated dealing with the color-fax issue since then because I was
aware that the JPEG routines were being rewritten in 4.0, and I decided
it best to figure out what was wrong when I got around to dealing with
the matter again with libtiff v4.0.

So now that I'm working on it, things appear not much different for me
than they were with 3.8.2...  The JPEG inside the TIFF is fine, but when
processed with the TIFF wrapper things don't work right.

Investigating this problem it appears that TIFFTAG_JPEGTABLES is being
written to the TIFF file even though the application does not
deliberately instruct it to be.  Consequently, the JPEGTABLES tag is
left as 2000 bytes of null data... which appears to confuse all TIFF
viewers that I have tested... and certainly it doesn't work with the
libtiff tools tiff2pdf and tiff2ps.

I've tried to prevent TIFFTAG_JPEGTABLES from being written to the TIFF
with...

     TIFFSetField(tif, TIFFTAG_JPEGTABLESMODE, 0);

... but this does not seem to work as I had hoped.

Is it silly of me to not want TIFFTAG_JPEGTABLES written to the TIFF?

Is TIFFTAG_JPEGTABLES supposed to be a mandatory tag for JPEG-in-TIFF?

If I should use TIFFTAG_JPEGTABLES, then is it only expecting me to put
the DHT and DQT tables - copied right from the JPEG data - into that
tag?  Or is there something more?

Since I need to make the application be compatible with libtiff 3.8.2 -
if there's not a way to avoid writing TIFFTAG_JPEGTABLES with that
version when writing JPEG-in-TIFF, then I'll probably just need to write
TIFFTAG_JPEGTABLES properly... but I wanted to understand if this was
intentional behavior by libtiff, or if this is a bug, or if I just don't
know what I'm doing (likely).

Thanks,

Lee.


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