spectralpython / spectral

Python module for hyperspectral image processing
MIT License
573 stars 139 forks source link

Keyword "offset" not handled properly in envi.create_image #21

Closed tboggs closed 9 years ago

tboggs commented 9 years ago

When the offset keyword is passed to envi.create_image, it adds an "offset" parameter to the ENVI header file instead of "header offset", which is the correct parameter name. The effect of this bug is that the image data are always written from the beginning of the file and the file is not padded at the beginning, as expected. This does not affect the reading of image data, since the "header offset" is not set to a nonzero value (and the spectral module then reads data from the beginning of the file). However, if one were to open the image data file (not the ENVI header file) and write within the expected header area, it would corrupt image data, since the image data starts at the beginning of the file.