AW: AW: [gdal-dev] gdalwarp and GTiff creation option NBITS

Schmitz, Uwe uwe.schmitz at bezreg-koeln.nrw.de
Wed Jun 16 06:28:44 EDT 2010


Frank,

I don't know if it's of interrest here, but
I always put a gdalwarp'ed output
file through gdal_translate to get a "clean"
file. Beside some other things, this step rearranges
the stripes and, IIRC, some older versions of
gdalwarp had problems in writing compressed
NBITS=1 files.

But just recently some ESRI (ArcGIS 9.x) users
claimed about problems reading files written
by gdal_translate with NBITS=1 and PHOTOMETRIC=MINISWHITE.
The picture is shown inverse and they have to manipulate
the palette to get the right view.

Looking at this, I concluded that the combination of
MINISWHITE *and* the presence of a palette causes
this behaviour. It seems that ArcGIS inverts the palette
in this case. After reading TIFF6.0 specification I think 
this is wrong. Otherwise there seems to be no need for a 
palette if PHOTOMETRIC isn't "PALLETTE". Because there
is no chance to get this problem corrected in ArcGIS, I decided
to patch geotiff.cpp to write out a palette only if 
PHOTOMETRIC_INTERPRETATION is "PALETTE". I don't know, if this
will have any other side effects, but for the moment it
fixes the ArcGIS problem.

If this path isn't the right one, IMO we need at least an 
configuration option like "PALETTE=(YES/NO)" to prevent
palette writing.

Hope this helps a little bit.

Regards
Uwe


More information about the gdal-dev mailing list