Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery022.isp.belgacom.be (Postfix) with ESMTP id 9B4B31A40F5
	for <joris.at.lebbeke@skynet.be>; Mon, 11 Feb 2008 18:18:52 +0100 (CET)
Authentication-Results: in.mx.skynet.be; dkim=permerror (body hash did not verify [final] [TEST]) header.i=@gmail.com
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 11 Feb 2008 18:18:51 +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 m1BGwe0c011498;
	Mon, 11 Feb 2008 11:59:18 -0500
Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.237])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m1BGwa5C011495
	for <tiff@lists.maptools.org>; Mon, 11 Feb 2008 11:58:37 -0500
Received: by wx-out-0506.google.com with SMTP id h29so4188784wxd.27
	for <tiff@lists.maptools.org>; Mon, 11 Feb 2008 08:58:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	bh=1OI7jqoeJy7AqvGy4C8w5Vr0itbMSOj6ej83L/Kg/e8=;
	b=aFUjDEyNPl1l52PvULGFS4Sl6gJdyW9d8oHS9jeXsEVL5doqHu05rQGFux3ndw+dc+x4g5S7UkR6LKy0Jk/aaUHnOUtV0IA59mlv3s84CJSjMziX9h3P03G04fJLoAVxq5YRGKX464DJO9cJ3lFuDWCA7sFNdab3PQPOJUl0roQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references;
	b=pvCyht+dOrk22K6egcAHCRM9rleHg1DOFEbMerEZrH6YH2rYtTNB0I7mRrqf4B9smmWjGq5dARoZZJ1At3rGcvRLMRzx8Bf4IcZ3UI73kVq5w2+5kdKhzhV5h7L0Q1obmncU41DGrrsiB4Wo+jD1oLSjGJB9QRu4otgZD4iRZ7k=
Received: by 10.140.171.4 with SMTP id t4mr102979rve.230.1202747595980;
	Mon, 11 Feb 2008 08:33:15 -0800 (PST)
Received: by 10.141.185.2 with HTTP; Mon, 11 Feb 2008 08:33:15 -0800 (PST)
Message-ID: <ed62030a0802110833mbb06850q1c31859acb569498@mail.gmail.com>
Date: Mon, 11 Feb 2008 11:33:15 -0500
From: "James Sumners" <james.sumners@gmail.com>
To: tiff@lists.maptools.org
In-Reply-To: <ed62030a0802110752v24461215of3beb1ce6a2484ec@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <ed62030a0802110752v24461215of3beb1ce6a2484ec@mail.gmail.com>
Subject: [Tiff] Re: Help with TIFFWriteScanline()
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.00002a88
X-MSP-STORE: Mon, 11 Feb 2008 18:18:52 +0100
Status:   

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


-- 
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/
