-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset is outside the bounds of the DataView #52
Comments
Hi @skynice Thanks for submitting this issue. This seems like an error with LZW decoding. Could you please provide the TIFF file where this error occurs? Maybe I can have a look at it. |
@constantinius please download in http://182.92.155.46:81/geotiff.tif |
@constantinius i clone the git project , in my project ,i use like this: <title>Title</title> <script src="./geotiff.bundle.js" type="text/javascript"></script> <script> let filename = "geotiff.tif"; let pool = new GeoTIFF.Pool(); GeoTIFF.fromUrl(filename).then(function(tiff){ tiff.readRasters({interleave:true},pool).then(function(raster){ console.log('a') }); }).catch(function(error){ console.error(error) }); </script> my browser is chrome 61.0.3163.79 please download in http://182.92.155.46:81/localhost.zip .see my chrome request deatials |
@constantinius if i use like this, the worked... <title>Title</title> <script src="./geotiff.bundle.js" type="text/javascript"></script> <script> let filename = "geotiff.tif"; var xhr = new XMLHttpRequest(); xhr.open('GET', filename, true); xhr.responseType = 'arraybuffer'; xhr.onload = function(e) { let arrayBuffer = this.response; GeoTIFF.fromArrayBuffer(arrayBuffer).then(function(tiff ){ tiff.getImage(0).then(function(image){ let bbox = image.getBoundingBox(); console.log(bbox); let width = image.getWidth(); let height = image.getHeight() image.readRasters().then(function(rasters){ console.log('a') }); }).catch(function(error){ console.log(error) }) }) } xhr.send(); /* GeoTIFF.fromUrl(filename).then(function(tiff){ tiff.getImage(0).then(async function(image){ let bbox = image.getBoundingBox(); console.log(bbox); let width = image.getWidth(); let height = image.getHeight() let data = await image.readRasters(); console.log(data.length) }).catch(function(error){ console.log(error) }) }).catch(function(error){ console.error(error) });*/ </script> |
Alright, I see, I'll investigate further! |
@skynice The problem seems to be twofold. First: your server does not seem to understand HTTP Range requests, as it seems to answer with the complete file, when it actually only should respond with a portion of it. Second: there seems to be a bug in handling exactly that case in the If you are looking for a solution right now, you can use your second approach (downloading beforehand and using In any case, I'll try to fix the issue, but I cannot promise that it will be in the near future, as I'm quite involved in other tasks. Please let me know if you have found a suitable solution. Thanks again for reporting this issue! |
@constantinius thank you very much. i use webstorm nesting web server found the problem.today i receiver your reply ,i try iis or node express ,the function correctly |
Hi @constantinius, Do you have an estimate when this issue with |
Do you have the same issue? If yes, you could mitigate it by switching to a server that properly supports range requests and the issue should not arise. Regarding the issue itself: the response size is not actively enforced, but it is handled in a more robust way when unexpectedly the whole file is returned. I think there need to be more configuration options for those cases (like raising errors, when the whole file is returned unexpectedly or just continue). There is currently no direct plan to fix the issue, as there are currently no resources to address this issue. |
Ok, thanks. I have some what similar issue but nothing that can't be worked around. Was just curious about the plans regarding this issue. |
`[Violation] 'setTimeout' handler took 62ms
lzw.js?8b40:17 ran off the end of the buffer before finding EOI_CODE (end on input code)
getByte @ lzw.js?8b40:17
geotiffimage.js?5c03:327 Uncaught (in promise) RangeError: Offset is outside the bounds of the DataView
at DataView.getFloat32 ()
at eval (geotiffimage.js?5c03:327)
source.js?c402:32 Uncaught (in promise) RangeError: Invalid typed array length: -610682
at typedArrayConstructByArrayBuffer ()
at new Uint8Array (native)
at readRangeFromBlocks (webpack-internal:///143:116:23)
at BlockedSource._callee3$ (webpack-internal:///143:454:51)
at tryCatch (webpack-internal:///94:63:40)
at Generator.invoke [as _invoke] (webpack-internal:///94:337:22)
at Generator.prototype.(anonymous function) [as next] (webpack-internal:///94:96:21)
at step (webpack-internal:///29:17:30)
at eval (webpack-internal:///29:28:13)
at
readRangeFromBlocks @ source.js?c402:32
source.js?c402:32 Uncaught (in promise) RangeError: Invalid typed array length: -620184
at typedArrayConstructByArrayBuffer ()
at new Uint8Array (native)
at readRangeFromBlocks (webpack-internal:///143:116:23)
at BlockedSource._callee3$ (webpack-internal:///143:454:51)
at tryCatch (webpack-internal:///94:63:40)
at Generator.invoke [as _invoke] (webpack-internal:///94:337:22)
at Generator.prototype.(anonymous function) [as next] (webpack-internal:///94:96:21)
at step (webpack-internal:///29:17:30)
at eval (webpack-internal:///29:28:13)
at `
The text was updated successfully, but these errors were encountered: