[Gdal-dev] colormap problem using gdal_translate

Frank Warmerdam warmerdam at pobox.com
Mon Aug 7 11:19:26 EDT 2006


guillaume huby wrote:
> On 8/7/06, *Frank Warmerdam* <warmerdam at pobox.com 
> <mailto:warmerdam at pobox.com>> wrote:
> 
>     Could you email me your .clr file?  I suspect there is a small
>     problem in
>     the .clr reading code in some cases.
> 
> 
> Frank,
> 
> Thank you for looking at this problem.
> Please find the .clr file attached to this mail.

Guillaume,

I have confirmed there was a bug in the .clr reader for the EHDR driver.
When there was a comment line starting with # at the beginning of the file,
it would be counted as the first color map entry.

The change looks like this, if you need to apply it to your own
local source.

diff -u -r1.39 ehdrdataset.cpp
--- ehdrdataset.cpp     7 Jun 2006 16:19:41 -0000       1.39
+++ ehdrdataset.cpp     7 Aug 2006 15:19:10 -0000
@@ -1298,6 +1298,9 @@
              if ( !pszLine )
                  break;

+            if( *pszLine == '#' )
+                continue;
+
              char       **papszValues = CSLTokenizeString2(pszLine, "\t ",
                                                             CSLT_HONOURSTRINGS);
              GDALColorEntry oEntry;

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    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list