2011.11.30 11:23 "[Tiff] Inconsistent metadata report for CMYK 8-bit image", by Mateusz_Łoskot

2011.12.13 13:08 "Re: [Tiff] Inconsistent metadata report for CMYK 8-bit image", by Mateusz_Łoskot

On 30 November 2011 13:58, Even Rouault <even.rouault@mines-paris.org> wrote:

#################################################################### 2) gdalinfo (from current OSGeo4W package)

C:\> gdalinfo Shadow_cmyk8.tif

Warning 1: TIFFReadDirectory:Unknown field with tag 37724 (0x935c) encountered Driver: GTiff/GeoTIFF

Files: Shadow_cmyk8.tif
Size is 768, 505
Coordinate System is `'
Metadata:

>>   TIFFTAG_SOFTWARE=Adobe Photoshop CS3 Windows
>>   TIFFTAG_DATETIME=2011:10:31 14:09:04
>>   TIFFTAG_XRESOLUTION=72
>>   TIFFTAG_YRESOLUTION=72
>>   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

Image Structure Metadata:

>>   SOURCE_COLOR_SPACE=CMYK
>>   INTERLEAVE=PIXEL

Corner Coordinates:

>> Upper Left  (    0.0,    0.0)
>> Lower Left  (    0.0,  505.0)
>> Upper Right (  768.0,    0.0)
>> Lower Right (  768.0,  505.0)
>> Center      (  384.0,  252.5)

Band 1 Block=768x2 Type=Byte, ColorInterp=Red

>>   Mask Flags: PER_DATASET ALPHA

Band 2 Block=768x2 Type=Byte, ColorInterp=Green

>>   Mask Flags: PER_DATASET ALPHA

Band 3 Block=768x2 Type=Byte, ColorInterp=Blue

>>   Mask Flags: PER_DATASET ALPHA

Band 4 Block=768x2 Type=Byte, ColorInterp=Alpha

Which one is right?

How many bits per sample and how many samples per pixel is there?

By default, with unusual color spaces like CMYK, GDAL will go through the libtiff RGBA API that does the colorspaces conversions and expose a regular RGBA dataset to GDAL.

You can try however: gdalinfo GTIFF_RAW:Shadow_cmyk8.tif

Even,

I had no idea about this option.

It looks someone is on "new feature into GDAL every day" rampage ;D Big thanks!

Best regards,

--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org