<div dir="ltr">Hi all,<div><br></div><div>I am having some problems converting a very simple TIFF file to an ENVI format one.</div><div>The file is one band file with just two values (longitudes around 145 deg).</div><div><br></div><div><div><font face="monospace">>gdalinfo test.tiff -mm<br>Driver: GTiff/GeoTIFF<br>Files: test.tiff<br>Size is 2, 1<br>Coordinate System is `'<br>Image Structure Metadata:<br>  INTERLEAVE=BAND<br>Corner Coordinates:<br>Upper Left  (    0.0,    0.0)<br>Lower Left  (    0.0,    1.0)<br>Upper Right (    2.0,    0.0)<br>Lower Right (    2.0,    1.0)<br>Center      (    1.0,    0.5)<br>Band 1 Block=2x1 Type=Float64, ColorInterp=Gray<br>    Computed Min/Max=145.333,145.351  <br></font></div><div></div></div><div><br></div><div><br></div><div>I convert the file to ENVI format using gdal_translate command:</div><div><font face="monospace">>gdal_translate -of ENVI test.tiff test.IMG<br></font></div><div><br></div><div><br></div><div>The command does not give any errors. When I read back the ENVI file I get the following error:</div><div><br></div><div><font face="monospace">>gdalinfo test.IMG -mm<br>ERROR 1: A marker ID was expected (0xff--) instead of 000028fc<br><br>ERROR 1: opj_read_header() failed<br>gdalinfo failed - unable to open 'my_path\test.IMG'.<br></font></div><div><br></div><div><p style="margin:0px;white-space:pre-wrap">I'm not sure why it tries to open the ENVI file using the  OpenJPEG reader. Anyway I'm using GDAL 2.4.4 and OpenJPEG 2.3.0. I tried GDAL 3.1.2, but I get the same error.</p></div><div><div>I also tried to gdalinfo the ENVI file with an older version of GDAL (2.1.1) and it can properly read it. Here is the output</div><div><br></div><div><font face="monospace">>gdalinfo test.IMG -mm<br>Driver: ENVI/ENVI .hdr Labelled<br>Files: test.IMG<br>      test.hdr<br>Size is 2, 1<br>Coordinate System is `'<br>Image Structure Metadata:<br>  INTERLEAVE=BAND<br>Corner Coordinates:<br>Upper Left  (    0.0,    0.0)<br>Lower Left  (    0.0,    1.0)<br>Upper Right (    2.0,    0.0)<br>Lower Right (    2.0,    1.0)<br>Center      (    1.0,    0.5)<br>Band 1 Block=2x1 Type=Float64, ColorInterp=Undefined<br>    Computed Min/Max=145.333,145.351<br></font></div><div><br></div><div>I wonder whether I'm doing something wrong in creating the file or whether this is a problem in the ENVI driver.</div><div>Attached are both input TIFF and output ENVI file generated by gdal_translate.</div><div><br></div><div>Thanks in advance for your help,</div><div>Calogero </div></div><div><div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Calogero Mauceri<br>Software Engineer<br><br>Applied Coherent Technology Corporation (ACT)<br><a href="http://www.actgate.com" target="_blank">www.actgate.com</a><br></div></div></div></div></div>