Return-Path: <tiff-bounces@lists.maptools.org>
Received: from mailgate003.isp.belgacom.be (mailgate003.isp.belgacom.be [195.238.6.88])
        by inmx008.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-IN-2.32) with ESMTP id l5R7EM84000516
        for <joris.at.lebbeke@skynet.be>; Wed, 27 Jun 2007 09:14:24 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 27 Jun 2007 09:14:23 +0200
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 l5R6uAfX008759;
	Wed, 27 Jun 2007 02:57:11 -0400
Received: from libertypr.net (linksmail.libertypr.net [63.245.32.15])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id l5R6ts3s008750
	for <tiff@lists.maptools.org>; Wed, 27 Jun 2007 02:55:55 -0400
Received: from sirius.homelinux.net [24.138.203.120] by libertypr.net with
	ESMTP (SMTPD-9.20) id A9F90450; Wed, 27 Jun 2007 02:55:53 -0400
Date: Wed, 27 Jun 2007 02:55:54 -0400
From: Renier Morales =?ISO-8859-1?Q?Rodr=EDguez?=
	<renier@morales-rodriguez.net>
To: tiff@lists.maptools.org
Message-ID: <20070627025554.0cf52862@sirius.homelinux.net>
X-Mailer: Claws Mail 2.9.1cvs38 (GTK+ 2.10.9; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	l5R6ts3s008750
Subject: [Tiff] Fw: Patch: TIFF Group 3/4 decoder support for PIL 1.1.6
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
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by inmx008.isp.belgacom.be id l5R7EM84000516
X-UIDL: 000000000023ceae.00002483
X-MSP-STORE: Wed, 27 Jun 2007 09:14:30 +0200
Status: RO

Resending. First email was over 40KB because of attachment and got held
up. Attachment can be found here:
http://www.pastebin.ca/591452

Begin forwarded message:

Date: Wed, 27 Jun 2007 02:38:50 -0400
From: Renier Morales Rodr=EDguez <renier@morales-rodriguez.net>
To: image-sig@python.org, tiff@lists.maptools.org
Subject: Patch: TIFF Group 3/4 decoder support for PIL 1.1.6


Hello,
Attached is a patch to add TIFF Group 3/4, TIFF CCITT, and TIFF RAW_16
decoding to PIL 1.1.6. The lack of this in PIL is something people have
complained/asked about off and on for years (from looking at mailing
lists and forums on google). However, this is not a new patch. It is
completley based on a patch by Vladimir Pastukhov posted to the
image-sig mailing list in the year of 2003
(http://mail.python.org/pipermail/image-sig/2003-July/002354.html). All
I have done is adapted it so that it applies to PIL 1.1.6. I
tested it against libtiff 3.8.2.

One problem with the patch, and I suppose the reason why it never
catched on, is that it requires libtiff header files that are not
installed as per the current libtiff's installation process. These are
tiffiop.h, tif_dir.h, and tif_config.h. Thus, I am also cc'ing the
libtiff mailing list here. I solve the problem by adding the needed
files to the PIL patch from the libtiff configured source. I assume this
is not a problem license-wise as both libraries are under the BSD. Is
this correct?

I know this is far from ideal. There is a libtiff bug report from the
year 2004 (http://bugzilla.remotesensing.org/show_bug.cgi?id=3D688)
explaning the need for tiffiop.h and tif_dir.h to be installed
(tiffiop.h didn't use tiff_config.h back then). There is also the
explanation of why they are not installed (they contain private
structures and functions) along with the intention, but without
promises, of creating some separate interface for this kind of access.
I'm adding my vote to that request, but couldn't the header files in
question just be installed in the meantime? Given that there is no
timeline for such special interface and all.

The other problem is that, besides needing other eyes to revise the
patch, I don't know how to test this on Win32 or if more work is
required for that. Would need other interested people to take a shot.

I hope the libtiff developers won't see a problem with adding the
requested headers to the installation for now. It could be made to be
like a deprecated interface by using #warnings or something similar.
Then the problem of breaking applications when an interface to this
finally comes wouldn't be so bad as you could say everyone was warned.
Doing this simple change now, rather than just waiting for a formalized
solution later, would help people improve TIFF support
(multi-page, etc.) in PIL and others.

Thoughts?

	--Renier

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