[gdal-dev] Problem with pct2rgb.py

ValiSystem vali.system at free.fr
Tue Mar 18 09:02:16 EDT 2008


On 18 mars 08, at 12:58, Jean-Claude Repetto wrote:

> Hello,
> I have downloaded a map of Corsica at <http://www.ign.fr/telechargement/MPro/produit/SCANS/SCAN1000_Corse_L2E.zip 
> > .
>
> Now, I want to convert it with gdal_translate. As it uses a palette,  
> I first need to convert it to RGB.
> Usually, I use ImageMagick for that, but this time I decided to give  
> a try to pct2rgb.py.
>
> $ pct2rgb.py COR_0000.TIF COR_0000_64K.TIF
> 0Traceback (most recent call last):
>  File "/usr/bin/pct2rgb.py", line 162, in ?
>    tif_ds.GetRasterBand(iBand+1).WriteArray(dst_data,0,iY)
>  File "/usr/lib64/python2.4/site-packages/gdal.py", line 796, in  
> WriteArray
>
>  File "usr/lib64/python2.4/site-packages/osgeo/gdal_array.py", line  
> 157, in BandWriteArray
> ValueError: array does not have corresponding GDAL data type
>
>
>
> Imagemagick gives some warnings, but the result seems correct :
>
> $ convert COR_0000.TIF -type TrueColor COR_0000_64K.TIF
> convert: COR_0000.TIF: unknown field with tag 33550 (0x830e)  
> encountered. `TIFFReadDirectory'.
> convert: COR_0000.TIF: unknown field with tag 33922 (0x8482)  
> encountered. `TIFFReadDirectory'.
> convert: COR_0000.TIF: unknown field with tag 34735 (0x87af)  
> encountered. `TIFFReadDirectory'.
> convert: COR_0000.TIF: unknown field with tag 34737 (0x87b1)  
> encountered. `TIFFReadDirectory'.
>
>
> I don't understand what's wrong, any help would be appreciated.
>
> Thanks,
> Jean-Claude


Are you using a 64 bits system ? i've had this error on my 64 bits  
boxes (AMD), it seems linked to a problem with python bindings on 64  
bits runtime.




More information about the gdal-dev mailing list