2009.07.16 14:33 "[Tiff] reading an 8 bit image", by Joe Tracy

2009.07.20 15:55 "Re: [Tiff] reading an 8 bit image", by Persons, Michael

Yes without analyzing it completely (i.e. there may be even more issues), there is also a problem with adjusting for the current line (j*w).

When offsetting into the "raster" buffer to correctly compensate for which line / row of the image is being processed, the j*w would need to change to j*w*4 (i.e. current line* width * bytesPerPixel)

note:

(My original post bounced because it was too large so I changed to plain text and the pictures below were lost)

-michael

________________________________________
From: Joe Tracy [mailto:JTracy@akimn.com]
Sent: Friday, July 17, 2009 11:16 AM
To: Persons, Michael; tiff@lists.maptools.org
Subject: RE: reading an 8 bit image

Thank you Michael.  The was the answer.  However it did not work in the code I was using.  I had to emulate my GDI code, then change samples to 4.

This is the original code I was using:

Changing the ptr increment to 4 did not work.

This is the GDI code that works fine, samples (from the tiff header) = 1:

So I changed the code I originally sent to emulate this pointer iteration (and increment the raster pointer directly), but had to ignore the samples from the tif header and set it to 4.  then it works fine.

Thanks,
Joe