Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.b-one.net (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id 0CA71400107
	for <info@awaresystems.be>; Fri, 25 Jun 2010 00:44:42 +0200 (CEST)
Received: by mx-q.b-one.net (Postfix, from userid 106)
	id 03AA2907A2CB; Fri, 25 Jun 2010 00:44:28 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-q.b-one.net (Postfix) with ESMTP id 1EE7590CC278 for
 <info@awaresystems.be>; Fri, 25 Jun 2010 00:44:27 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id B524D1D184BCE; Thu, 24 Jun 2010
 17:43:48 -0500 (EST)
Received: from smtpauth20.prod.mesa1.secureserver.net
 (smtpauth20.prod.mesa1.secureserver.net [64.202.165.36]) by
 lists.maptools.org (Postfix) with SMTP id BC8101D184BCB for
 <tiff@lists.maptools.org>; Thu, 24 Jun 2010 17:32:37 -0500 (EST)
Received: (qmail 3593 invoked from network); 24 Jun 2010 22:32:37 -0000
Received: from unknown (24.249.190.225) by
 smtpauth20.prod.mesa1.secureserver.net (64.202.165.36) with ESMTP; 24 Jun
 2010 22:32:37 -0000
Message-ID: <4C23DD04.20009@kuttatech.com>
Date: Thu, 24 Jun 2010 15:32:36 -0700
From: Andrew Reading <areading@kuttatech.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5)
 Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0
MIME-Version: 1.0
To: tiff@lists.maptools.org
Subject: [Tiff] LibTIFF col_offset bug in stripped images
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

Hello,

LibTIFF seems to have a bug where the RGBA interface does not take into
account the col_offset value for stripped images (tiled images work
fine).  All images thus are read into the supplied buffer, but are
always fixed to the left side of the image.  The row_offset value, on
the other hand, works perfectly fine.  I was able to trace this down to
an offset issue in the

        static int gtStripContig(TIFFRGBAImage* img, uint32* raster,
uint32 w, uint32 h)

function.  Around line 868,

        pos = ((row + img->row_offset) % rowsperstrip) * scanline;

should read

        pos = ((row + img->row_offset) % rowsperstrip) * scanline +
(img->col_offset * img->samplesperpixel);

The remaining strip functions should probably be changed accordingly.


Regards,

Andrew

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