AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2009

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2009.12.07 16:06 "Problems with multiple strip G4 to single strip G4 tiff.", by Phillip Wiles
2009.12.08 17:53 "Re: Problems with multiple strip G4 to single strip G4 tiff.", by Phillip Wiles
2009.12.08 18:11 "Re: Problems with multiple strip G4 to single strip G4 tiff.", by Juergen Buchmueller
2009.12.09 07:47 "Re: Problems with multiple strip G4 to single strip G4 tiff.", by Phillip Wiles
2009.12.09 08:11 "Re: Problems with multiple strip G4 to single strip G4 tiff.", by Juergen Buchmueller

2009.12.09 08:11 "Re: Problems with multiple strip G4 to single strip G4 tiff.", by Juergen Buchmueller

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