Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas002.isp.belgacom.be (localhost [127.0.0.1])
        by inav022.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id j9S3kfYj031562
        for <joris.at.lebbeke@skynet.be>; Fri, 28 Oct 2005 05:46:41 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx019.isp.belgacom.be (inmx019.isp.belgacom.be [195.238.5.138])
        by inas002.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id j9S3kXMP007013
        for <joris.at.lebbeke@skynet.be>; Fri, 28 Oct 2005 05:46:33 +0200
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx019.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j9S3kWQm030247
        for <joris.at.lebbeke@skynet.be>; Fri, 28 Oct 2005 05:46:32 +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 j9S3goii031078;
	Thu, 27 Oct 2005 23:42:57 -0400
Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.193])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id j9S3gmvs031075
	for <tiff@lists.maptools.org>; Thu, 27 Oct 2005 23:42:48 -0400
Received: by xproxy.gmail.com with SMTP id s16so18250wxc
	for <tiff@lists.maptools.org>; Thu, 27 Oct 2005 20:42:47 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	b=QDUc4zYZBuS3UbB6k1pdkNBTfSit798196tANbqG971+dmQ5CInf9RmA8s7NJZhxpU8c/wfcbhmrxskMfbEFdwXmj4t+tcBvR6lJ2BntjhsRHjkWHGJQIIeiqMqPxshK7J0Gy5shrHpF/+YtlRFnfgRVdRKtjdLIf11rWTQTEug=
Received: by 10.65.83.16 with SMTP id k16mr2052974qbl;
	Thu, 27 Oct 2005 20:42:46 -0700 (PDT)
Received: by 10.65.154.2 with HTTP; Thu, 27 Oct 2005 20:42:46 -0700 (PDT)
Message-ID: <931f8ea90510272042h20d5bb7qeead491c21b69a7c@mail.gmail.com>
Date: Thu, 27 Oct 2005 23:42:46 -0400
From: Frank Warmerdam <warmerdam@pobox.com>
To: David McKenzie <davidmck@austin.rr.com>
Subject: Re: [Tiff] How located pixels with BitsPerSample not bound to byte?
In-Reply-To: <004401c5db6e$45290990$6501a8c0@black>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
References: <75489204593.20051027094051@mail.ru>
	<931f8ea90510270657g5007545dr443fc2b1c9855d58@mail.gmail.com>
	<004401c5db6e$45290990$6501a8c0@black>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	j9S3gmvs031075
Cc: tiff@lists.maptools.org
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.00000dc2
X-MSP-STORE: Fri, 28 Oct 2005 05:46:41 +0200
Status:   

On 10/27/05, David McKenzie <davidmck@austin.rr.com> wrote:
> It so happens that while testing a viewer application I'm working on, two
> problems were tracked to this section of GDAL code (in geotiff.cpp). The
> first is apparently a simple coding error. Notice that the local variable
> iPixelBitSkip in the code excerpt is initialized but never used. I saw this
> first in a separate section that handles 12-bit samples as a special case.
> There I fixed the problem by simply replacing the statement "iBitOffset +=
> 12" with "iBitOffset += iPixelBitSkip". In the section here that handles
> other 1-32 bit samples a similar fix is necessary. I haven't tried the very
> latest version of OpenEV, but I believe for the above reason it can't
> correctly display many of Bob Friesenhahn's example TIFFs (see below) with
> "contig" in the name.

David,

Yikes!  And here I thought I had tested comprehensively with
Bob's images.  I must have been out of it that day.  I have fixed
this and now all the contig rgb images work fine in OpenEV.

Note there is the fix for incrementing iBitOffset, and a fix
to the computation of nBitsPerLine.

The updated code is available at:

  http://www.gdal.org/srctree/frmts/geotiff.cpp

> The second problem involves this same section of code (1-32 bit sample...

I'll stay out of this issue, though I suspect that 24bit data should not
be byte swapped.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

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