[gdal-dev] Wrong values writing ENVI image (both as ENVI or as GTiff)

Agustin Lobo alobolistas at gmail.com
Wed Dec 19 00:51:44 PST 2018


I have an image of 144 rows x 640 cols x 224 bands in ENVI format, in bil and
UInt16 (hdr states interleave = bil, data type = 12).

In order to convert to GTiff, I state:
gdal_translate -ot UInt16 input.raw test.tif

but values in test.tif are wrong: e.g. a pixel with value of 1038.0 in
input.raw becomes 234 in test.tif

This is so even if I just save as ENVI format with:
gdal_translate -of ENVI -ot UInt16 input.raw test

gdal_translate works fine if the input ENVI image is BSQ.

Is this a bug or am I doing something wrong?

(I appollogize I cannot provide an small example as I cannot write an
ENVI format in BIL order)
(using gdal GDAL 2.3.2, released 2018/09/21 on Debian)

Thanks


More information about the gdal-dev mailing list