gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
277 stars 61 forks source link

write_tiff crashes with complex data and geotag #1911

Closed brandy125 closed 1 week ago

brandy125 commented 1 week ago

I am getting this error when trying to write a geotiff with complex data and geotag:

GDL> a=complex(dist(500),dist(500))
GDL> geo={modelpixelscaletag:[0,0,0]}
GDL> write_tiff,'test.tif',a,/complex,geo=geo
% UPDATEGEOTAGSINIMAGE: test.tif is not existing or is not a TIFF file!
% Error occurred at: UPDATEGEOTAGSINIMAGE   339 /usr/local/share/gnudatalanguage/lib/utilities/updategeotagsinimage.pro
%                    WRITE_TIFF         467 /usr/local/share/gnudatalanguage/lib/write_tiff.pro
%                    $MAIN$          
% Execution halted at: $MAIN$          
GDL> 
brandy125 commented 6 days ago

Thanks @GillesDuvert for the patch.

Unfortunately I am not able to read the file back:

GDL> a=complex(dist(500),dist(500))
GDL> geo={modelpixelscaletag:[0,0,0]}
GDL> write_tiff,'test.tif',a,/complex,geo=geo
GDL> b=read_tiff('test.tif',geo=geon)
Unsupported PIXEL_TYPE: 0
% TIFF_READ: Failed to read TIFF image with defined parameters
% Error occurred at: READ_TIFF           27 /usr/local/share/gnudatalanguage/lib/read_tiff.pro
%                    $MAIN$          
% Execution halted at: $MAIN$