[Gdal-dev] color table

Frank Warmerdam warmerdam at pobox.com
Fri May 30 19:21:11 EDT 2003


Xiaodong Zhang wrote:
> Hi Frank,
> 
> I'm just wondering can I write a color table into a GeoTIFF file. I got 
> an error message saying that
> SetColorTable() not supported for existing TIFF files.
> 
> Thanks
> Xiaodong


Xiaodong,

I believe you can call SetColorTable() only on a newly created file
(created with the GDALDriver->Create() method) if you do it before writing
the first imagery.  This is a "quirk" of the TIFF library that makes it hard
to make some structural decisions (like whether an image has a color table)
after you have started writing imagery.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list