2012.07.18 11:01 "[Tiff] Problems reading TIFF with TIFFReadEncodedStrip", by Jorge Martin
I have developed a read/write TIFF image Strip and Tile oriented.
But I have problems reading an image. This image has the following tags:
ImageWidth (1 Short): 1500
ImageLength (1 Short): 6000
BitsPerSample (1 Short): 32
Compression (1 Short): Uncompressed
Photometric (1 Short): MinIsBlack
StripOffsets (35 Long): 8, 6008, 12008,...
SamplesPerPixel (1 Short): 1
RowsPerStrip (1 Short): 1
StripByteCounts (35 Long): 6000, 6000, 6000,...
XResolution (1 Rational): 0
YResolution (1 Rational): 0
ResolutionUnit (1 Short): Centimeter
As can be seen, the TIFF tags does not show any special issue,
only the 32bits per sample. The problem is when trying to read this image, I supposed that the function TIFFStripSize will return a size of 1500 (ImageWidth*RowsPerStrip*SamplesPerPixel) but it returns 6000, and I do not understand why it is obtaining this value.
If I read this image using TIFFReadEncodedStrip function and then
write it using TIFFWriteEncodedStrip there is no problem in the output image. But, If I try to plot the obtained buffer after read the whole image, the plot is very strange, it seems that the data in coded or something similar.
Can anybody help me in this issue?