silx-kit / vscode-h5web

VSCode extension to explore and visualize HDF5 files
https://marketplace.visualstudio.com/items?itemName=h5web.vscode-h5web
MIT License
33 stars 5 forks source link

Allow increasing 2GB file limit. #49

Open DeanTM opened 4 days ago

DeanTM commented 4 days ago

Is your feature request related to a problem?

I'm working with some large files, usually > 1TB, but the viewer is limited to files smaller than 2GB. If the file is greater than 2GB I need to open it through a different interface.

This is a problem because I'm working remotely and the second interface searches for files on my local computer. My workarounds are to:

Neither option is convenient, but because H5Web works with larger files in Jupyter Lab, I assume it's not an H5Web problem but rather a VSCode extension limitation.

Requested solution or feature

Allow users to increase the 2GB limit in the workspace or user settings (if this is already the case, where is the setting?)

Alternatives you've considered

Additional context

axelboc commented 4 days ago

Indeed, it's due to the fact that the extension runs in a sandboxed webview. The only way I found for the webview to receive a JavaScript File object (to avoid the 2GB limit) is if the user initiates an interaction (file picker or drag-and-drop) from inside the webview via an <input type="file"> element. If there's another way, I'm not aware of it.

When the user selects a file in the sidebar, VS Code exposes this file to the webview through a URI. H5Web then fetches its entire content with an HTTP request, which is where the 2 GB buffer size limit comes in.

A solution might be to implement a provider in H5Web that can perform HTTP range requests in order to fetch only the parts of the file that are needed. There's an issue for this in H5Web: https://github.com/silx-kit/h5web/issues/1264. Of course, this first assumes that VS Code can respond to HTTP range requests.

andygotz commented 2 hours ago

Question by a non-expert: does this mean if H5Web implemented a file selection box and loaded the file itself i.e. not through VSCode, it would be able to go beyond the 2GB limit? If this is not too difficult to implement it could provide a work-around for desktop users. Just a thought!

axelboc commented 1 hour ago

This is already the case:

image

Unfortunately, this is not sufficient for @DeanTM due to the remote use case:

If the file is greater than 2GB I need to open it through a different interface. This is a problem because I'm working remotely and the second interface searches for files on my local computer.