AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2009.07.16 14:33 "[Tiff] reading an 8 bit image", by Joe Tracy
2009.07.17 17:28 "Re: [Tiff] reading an 8 bit image", by Persons, Michael
2009.07.20 15:55 "Re: [Tiff] reading an 8 bit image", by Persons, Michael
2009.07.20 17:38 "Re: [Tiff] reading an 8 bit image", by Joe Tracy

2009.07.20 17:38 "Re: [Tiff] reading an 8 bit image", by Joe Tracy

Yes. Mine bounced back too.. next time I will put the code in as text, not bitmaps..

Anyway, it is working fine.

Thanks,

joe

-----Original Message-----
From: Persons, Michael [mailto:michael.persons@hp.com]
Sent: Monday, July 20, 2009 10:56 AM
To: Joe Tracy; tiff@lists.maptools.org

Subject: RE: reading an 8 bit image

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