-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Support use of resize() function in Web Workers #612
Comments
So, there's This works (in chromium at least):
But probably isn't very widely supported. |
I'd be glad to take a PR on |
ReferenceError: Image is not defined
Sure, gladly would contribute. Would you be alright with throwing exceptions if browser support for required functions (createImageBitmap, OffscreenCanvas, offscreen canvas 2d support, convertToBlob) is missing - for the inside web worker case, that is? |
Sorry for the delayed reply here! I'd be fine with exceptions being thrown. I'd probably just let the browser hit these errors rather than explicitly checking for support. |
After #775 we now have two implementations of texture resizing within this project, one that is cross-platform with ndarray-pixels, and another that is much faster but Node.js-only, based on Sharp. I think I've done as much as I am willing to do within this codebase to make this feature cross-platform, but unfortunately none of these implementations support Web Workers today. I'd still be glad to discuss this on the ndarray-pixels repository, if someone wants to make a PR there. Another option would be too look into replacing sharp (used by |
Is your feature request related to a problem? Please describe.
It would be nice to have an alternative for resizing images in a webworker, if that is somehow possible (that's half the problem I'm trying to solve with glTF-Transform).
Describe the solution you'd like
Looking at ndarray-pixels (browser-get-pixels.ts), since it uses
Image
(not available in web workers) as well asdocument.createElement('canvas')
(can probably be worked around withnew OffscreenCanvas()
), that might be tricky.I'd be happy to contribute something (to ndarray-pixels?), if you let me know what the requirements are (regarding dependencies, etc).
The text was updated successfully, but these errors were encountered: