bioimagesuiteweb / bisweb

This is the repository for the BioImage Suite Web Project
https://bioimagesuiteweb.github.io/webapp/
Apache License 2.0
79 stars 32 forks source link

can't provide URL from S3 with versionId #126

Closed yarikoptic closed 3 years ago

yarikoptic commented 3 years ago

e.g. both https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz?versionId=SHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy or urlquoted (since not sure how former legit is) https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https%3A//s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz%3FversionId%3DSHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy say "An error occured while ..." (note: a typo in "occur[r]ed") and console saying

viewer.html:1 Uncaught (in promise) Failed to load from https://s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz?versionId=SHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy(RangeError: Invalid typed array length: 1.2017398940635953e+23)
DevTools failed to load SourceMap: Could not load content for https://bioimagesuiteweb.github.io/webapp/bisweb-sw.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

stripping away ?versionId works, e.g. https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https%3A//s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz

XeniosP commented 3 years ago

I put in a tiny fix to "if fail" try to force gunzip and try again and this seems to work. I will push a version to the "alpha" channel

http://localhost:8080/web/viewer.html?image=https%3A//s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz%3FversionId%3DSHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy

         try {
             self.parseNIIModular(obj.data.buffer,forceorient);
         } catch(e) {
XeniosP commented 3 years ago

Try using this with

https://bioimagesuiteweb.github.io/alphaapp/viewer.html (replace webapp with alphaapp) in about 30 minutes, once github updates the page.