Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-c.b-one.net (mx-c.one.com [91.198.169.50])
	by mail9.b-one.net (Postfix) with ESMTP id 8A7DA40024C
	for <info@awaresystems.be>; Wed,  9 Dec 2009 09:19:36 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=6 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-c.b-one.net (Postfix) with ESMTP id C2D9458B
	for <info@awaresystems.be>; Wed,  9 Dec 2009 09:19:35 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 2EA671D6AC117;
	Wed,  9 Dec 2009 03:19:01 -0500 (EST)
Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18])
	by lists.maptools.org (Postfix) with ESMTP id 026451CE324B0
	for <tiff@lists.maptools.org>; Wed,  9 Dec 2009 03:11:40 -0500 (EST)
Received: from fwd07.aul.t-online.de by mailout04.t-online.de with smtp 
	id 1NIHe6-0002PN-05; Wed, 09 Dec 2009 09:11:38 +0100
Received: from ubuntu
	(GQO4viZVYhYXz3M9eGuAFNtfkTardAibkyvUJnNkVruMeTmm+IdGmwJxIjrpr38Zu5@[91.55.116.68])
	by fwd07.t-online.de
	with esmtp id 1NIHe6-0gwvcO0; Wed, 9 Dec 2009 09:11:38 +0100
Date: Wed, 9 Dec 2009 09:11:44 +0100
From: Juergen Buchmueller <pullmoll@t-online.de>
To: tiff@lists.maptools.org
Message-Id: <20091209091144.30c41e01.pullmoll@t-online.de>
In-Reply-To: <12c25ae0912082347s54321521t67b5913983e859e6@mail.gmail.com>
References: <12c25ae0912070806sf60553ckd2cbb1e17e9a5bf7@mail.gmail.com>
	<20091208191124.f39b5cbf.pullmoll@t-online.de>
	<12c25ae0912082347s54321521t67b5913983e859e6@mail.gmail.com>
X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.3; x86_64-pc-linux-gnu)
Mime-Version: 1.0
X-ID: GQO4viZVYhYXz3M9eGuAFNtfkTardAibkyvUJnNkVruMeTmm+IdGmwJxIjrpr38Zu5
X-TOI-MSGID: 09fff426-1615-432e-887b-d42d6f2c2a48
Subject: Re: [Tiff] Problems with multiple strip G4 to single strip G4 tiff.
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

On Wed, 9 Dec 2009 02:47:52 -0500
Phillip Wiles <pwiles38@gmail.com> wrote:

> I am 99.9% certain that it is my code that is causing the crash. I should
> have been clearer on that.

Ok, I thought you had checked that :)

> I downloaded GDB and it looks interesting, but it's likely overkill for this
> problem and likely over my head.

Nah, it's dead simple. Let your program write a coredump (perhaps
setting "ulimit -c unlimited" before), then run "gdb
path/to/your/program xyz.core" and do a "bt" for backtrace. If you
compiled your code with symbols (-g option of gcc) you'll see on which
line it was.

> I'm not asking that anyone do the work for me. I'm looking for direction (or
> explanation as to what I'm doing wrong) to the correct way to save the image
> a single strip, when the original image was multiple strip.

I thought you wanted to do it the other way round? Anyway, here's a
code snippet from my libtiff usage, omitting the setting of all the
other necessary tags:

/* write a striped image */
rowsperstrip = TIFFDefaultStripSize(hTIFF, fmt->image_length);
if (rowsperstrip > fmt->image_length) {
	rowsperstrip = fmt->image_length;
	LOG(LINFO,(_fun,"clamping to image length: %u\n",
		rowsperstrip));
}
rc = TIFFSetField(hTIFF, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
for (y = 0; y < fmt->image_length; y++) {
	tdata_t row = (tdata_t)(tiff->mem.data + y * tiff->stride + x);
	rc = TIFFWriteScanline(hTIFF, row, y, 0);
	if (rc != 1) {
		LOG(LERROR,(_fun,"TIFFWriteScanline(%p,%p,%d,%d) "
		 "failed (%d)\n", tiff, row, y, 0, rc));
		goto abort;
	}
}
...

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