2008.03.29 04:18 "[Tiff] TIFFReadRawStrip buffer data type", by James Sumners

2008.03.29 14:58 "Re: [Tiff] TIFFReadRawStrip buffer data type", by Frank Warmerdam

If I supply TIFFReadRawStrip() with a buffer of type int, and read a grayscale image, I assume that each position in the buffer would be a value between 0 and 255, right? If so, then I'm a little confused about the debug output of my program[1]. It seems to be reading a ten digit integer for each position in the buffer. Am I doing something wrong?

[1] -- http://student.claytonstate.net/~jsumners/wavelet.zip (source code)

James,

I didn't inspect the TIFF files or dig too deeply in your code, but basically it is likely that the pixels are being read back as 8bits per pixel values, but you are reading them into a 32bit integer buffer. If there is only one sample per pixel, then you will end up with four pixels packed into each int.

Try using an "unsigned char" buffer instead of int.

Best regards,
--
---------------------------------------+--------------------------------------

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGeo, http://osgeo.org