Open Samreay opened 9 years ago
@Samreay It's been a while since I've thought about it, so my memory is a little fuzzy on this issue. I recall there being a limitation. I once tried to support 64 bit integers, but since javascript doesn't natively support that data type, it would require representing a Int64 array using 2 Uint32Array
s, along with some wacky endian flips.
As you point out, Float64 support should be easier. Do you mind submitting a PR? Adding a Float64 test would also be appreciated.
Yeah, Javascript can only represent ints up to 53 bits as it stores everything as floats.
I'll figure out how to make a pull request, a test, and submit it. Cheers.
Very true, but I believe the typed arrays are an exception to the 53 bit limitation.
Thanks!
I've been having some major problems building the code (coffeescript on windows is apparently temperamental) and I lack the knowledge of node and coffeescript to be able to figure out what is actually the problem.
I've thrown what I had as a patch into a gisthub (https://gist.github.com/Samreay/f9c519dc9bebd8e6f1cf), so hopefully it comes in use if you have time to add it in properly at a later date.
@Samreay Thanks for the gist. I should be able to incorporate it.
At the moment, all 64bit floating point data gets converted to 32bit. The
Image.prototype._getFrame
function should have the bitpix<0 if condition updated to differentiate between values of -64 and -32.Specifically, modifying image.coffee such that from line 88 the code reads: