Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx006.isp.belgacom.be (inmx006.isp.belgacom.be [195.238.2.106])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id iB7CMAFc004686
        for <joris.at.lebbeke@skynet.be>; Tue, 7 Dec 2004 13:22:10 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx006.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id iB7CLurm007041
        for <joris.at.lebbeke@skynet.be>; Tue, 7 Dec 2004 13:21:58 +0100
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 031D64DFFEF; Tue,  7 Dec 2004 07:21:42 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx018.isp.belgacom.be (outmx018.isp.belgacom.be
	[195.238.2.117])
	by xserve.flids.com (Postfix) with ESMTP id BFD674DFFCA
	for <tiff@remotesensing.org>; Tue,  7 Dec 2004 07:21:38 -0500 (EST)
Received: from outmx018.isp.belgacom.be (localhost [127.0.0.1])
	by outmx018.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id iB7CLTOX000681
	for <tiff@remotesensing.org>; Tue, 7 Dec 2004 13:21:29 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (221-175.245.81.adsl.skynet.be [81.245.175.221])
	by outmx018.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id iB7CLT6g000675
	for <tiff@remotesensing.org>; Tue, 7 Dec 2004 13:21:29 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <002101c4dc57$5cc8de70$ddaff551@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: <tiff@remotesensing.org>
References: <41B5A137.1030103@llgc.org.uk><000701c4dc50$6d6c6050$ddaff551@dfgrrxsknr4e><41B5A448.9070609@llgc.org.uk><000b01c4dc52$ad0e21b0$ddaff551@dfgrrxsknr4e>
	<41B5A8BD.5080203@llgc.org.uk>
Subject: Re: [Tiff] Fetching pixel data from 4bit tiff
Date: Tue, 7 Dec 2004 13:21:56 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 34aa36982e6a3991081b4eaa7ae054dc

Dan,

> TIFF Directory at offset 0x8

That certainly is indeed a grayscale TIFF.

> Basically I'm trying to take a sample of pixels across the middle of the
> image, both horizontal and vertical (yes I know the sample algo is wrong for
> the horizontal.. I've yet to get to that :) )

I'm no C guru myself (Delphi coder instead), but from a quick scan through the
code, it seems that the initialization, loop condition, and increment of i in
both loops is wrong. Try this instead:

for (i =TheImage.width/2*4;
      i < (TheImage.width*TheImage.height*4);
      i +=TheImage.width*4) {
for (i =TheImage.width*(TheImage.height/2)*4;
      i <TheImage.width*(TheImage.height/2+1)*4;
      i+=4) {

Quite possible I made a mistake myself, though, I'm not a C coder, sorry.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
