Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery012.isp.belgacom.be (Postfix) with ESMTP id AD4B7254048
	for <joris.at.lebbeke@skynet.be>; Thu, 14 Feb 2008 20:30:05 +0100 (CET)
Authentication-Results: in.mx.skynet.be; dkim=neutral (message not signed) header.i=none
Received: from unknown (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 14 Feb 2008 20:30:04 +0100
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 m1BHLKMJ012670;
	Mon, 11 Feb 2008 12:22:02 -0500
Received: from exprod6og104.obsmtp.com (exprod6og104.obsmtp.com [64.18.1.187])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m1BHL72Z012651
	for <tiff@lists.maptools.org>; Mon, 11 Feb 2008 12:21:08 -0500
Received: from source ([192.150.11.134]) by exprod6ob104.postini.com
	([64.18.5.12]) with SMTP; Mon, 11 Feb 2008 09:21:06 PST
Received: from inner-relay-1.corp.adobe.com ([153.32.1.51])
	by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
	m1BHIVin025466; Mon, 11 Feb 2008 09:18:32 -0800 (PST)
Received: from fe2.corp.adobe.com (fe2.corp.adobe.com [10.8.192.72])
	by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id
	m1BHKtRC020028; Mon, 11 Feb 2008 09:21:05 -0800 (PST)
Received: from namail3.corp.adobe.com ([10.8.192.66]) by fe2.corp.adobe.com
	with Microsoft SMTPSVC(6.0.3790.1830); 
	Mon, 11 Feb 2008 09:20:55 -0800
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: RE: [Tiff] Re: Help with TIFFWriteScanline()
Date: Mon, 11 Feb 2008 09:20:34 -0800
Message-ID: <3B96007137B4CE4E85114278E640DC330131C8C1@namail3.corp.adobe.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] Re: Help with TIFFWriteScanline()
Thread-Index: Achsz323p47U4Jb7Qy6aMcD6I4jwqgAAutSI
References: <ed62030a0802110752v24461215of3beb1ce6a2484ec@mail.gmail.com>
	<ed62030a0802110833mbb06850q1c31859acb569498@mail.gmail.com>
From: "Chris Cox" <ccox@adobe.com>
To: "James Sumners" <james.sumners@gmail.com>, <tiff@lists.maptools.org>
X-OriginalArrivalTime: 11 Feb 2008 17:20:55.0167 (UTC)
	FILETIME=[7594B0F0:01C86CD2]
X-MIME-Autoconverted: from quoted-printable to 8bit by duke.maptools.org id
	m1BHL72Z012651
Cc: 
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-UIDL: 000000000023ceae.00002aa9
X-MSP-STORE: Thu, 14 Feb 2008 20:30:05 +0100
Status:   

I think you're confusing SamplesPerPixel with BitsPerSample.


-----Original Message-----
From: tiff-bounces@lists.maptools.org on behalf of James Sumners
Sent: Mon 2/11/2008 8:33 AM
To: tiff@lists.maptools.org
Subject: [Tiff] Re: Help with TIFFWriteScanline()
=20
After browsing the mailing list archives I found out about the
tiffinfo tool. tiffinfo reported that my original image had a
SamplesPerPixel of 1. For some reason, unbeknownst to me, my program
is getting a value of 0 for SamplesPerPixel from the original image.
So I manually set the value to 8, because that is what I understand
the specification to be (8 or 16 SPP for grayscale/color and 1 SPP for
bilevel). After changing my manual SPP value from 8 to 1 the copied
image is written correctly.

This is the first time I've done any graphics programming. So I'm sure
that I am not understanding something. Would someone please explain
this situation to me? Would 8 SPP squeeze the image into a smaller
space? How is 1 SPP producing a grayscale image?

On Feb 11, 2008 10:52 AM, James Sumners <james.sumners@gmail.com> wrote:
> I've written a program[1] that reads a grayscale image into memory and
> writes it to another file. The problem is that the new image is
> multiple copies of the original image in the same pixel space. It's a
> bit difficult to describe. Included in the zip is "fractal_gs.tiff",
> the original image, and "fractal_gs_2.tiff", the copy.
>
> If I try to write the new image with TIFFWriteRawStrip() I get append
> errors. Using TIFFWriteScanline() I get an image, just not the one I
> expect. What am I doing wrong?
>
> [1] -- http://student.claytonstate.net/~jsumners/files/tiff_copy.zip


--=20
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/


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