astrojs / fitsjs

JavaScript library for reading the FITS astronomical format. Functionality includes reading of images, data cubes, compressed images, binary and ascii tables.
http://astrojs.github.io/fitsjs/
MIT License
85 stars 21 forks source link

Support for 16bits unsigned images #28

Open Nunkiii opened 7 years ago

Nunkiii commented 7 years ago

Salut, There is a problem for loading unsigned 16 bits images ( BITPIX = 16 and BZERO = 32768) This is the fix to handle them correctly :

in Image.prototype._getFrame :

Line 760: change ... case 16:
tmp = new Int16Array(buffer); ... with ... case 16:
if(bzero==32768)
tmp = new Uint16Array(buffer);
else
tmp = new Int16Array(buffer);
...

Thanks for your nice work! Pierre

T0T4R4 commented 5 years ago

Is there no-one to implement this fix ?