Unable to write correctly image of unsigned long pixel type
Mantis Issue 406, reported by mgrizonnet, assigned to cvalladeau, created: 2011-08-19
I think that there is perhap's a problem when OTB write image of unsigned long pixels (UInt32 I think). The output image pixel type is interpreted as "Byte" (gdalinfo).
I've pushed a test to show the problem in Testing/Fa(I'll add informations in the aditionnal informations)
The test set the pixel value at index [1,1] to 1 in the allocated image. The image is only written and read after that. the output image pixel value at index [1,1] is 0 after that. It is the pixel at index [8,8] which as the value 1 in the output image.
Weird bug...
the test in Testing/Fa : http://hg.orfeo-toolbox.org/OTB/file/769be4ec6390/Testing/Fa/WriteUnsignedLong.cxx
1314085060 - C ValladeauThe bug appears on every platform : http://dash.orfeo-toolbox.org/testDetails.php?test=5432255&build=63050. We have the issue with unsigned long and long.
1314089068 - jguinetTIFF tag header is :
ImageWidth (1 Short): 10 ImageLength (1 Short): 10 BitsPerSample (1 Short): 8 Compression (1 Short): Uncompressed Photometric (1 Short): MinIsBlack SamplesPerPixel (1 Short): 1 PlanarConfig (1 Short): Contig TileWidth (1 Short): 736 TileLength (1 Short): 736 TileOffsets (1 Long): 158 TileByteCounts (1 Long): 541696 SampleFormat (1 Short): 1
BitsPerSaMple is set to 8
1314113511 - C ValladeauThe problem seems to come frome otbGDALImageIO. When we write the image, we set look at the pixel type and don't handle the type ULONG (defined in itkImageIOBase). m_ComponentType takes the default value : 1, and m_PxType is set to GDT_Byte (enum of the gdal.h file).
The problem is that GDAL doesn't have a type for long or unsigned long.
1314114463 - christophttp://