Comments (5)
Ah, looks like unpkg is able to correctly find the codec files! This works:
let webp = await import(`https://unpkg.com/@jsquash/[email protected]/index.js?module`);
let imageData = await webp.decode(arrayBuffer);
Could an example like that be added to the readme? Let me know if you want me to make the pull request.
from jsquash.
@josephrocca Thanks for the suggestion. I can look into adding an unpkg example 👍
Looks like there might be an issue with jsDelivr and wasm files. Is there a known fix for this? If not, I think it's best to stick with unpkg.
I will note that this package has been built specifically for the browser runtimes. I am unsure of Deno and Bun compatibility at this time and am in no rush to implement.
from jsquash.
Thanks! A simple example like that in the readme would be really helpful helpful I think.
It doesn't currently work with Deno (just says "Decoding error"), but that's likely not your problem anyway, since Deno aims to be ~completely compatible with browsers (so long as e.g. DOM isn't needed), so it should eventually work as they continue to improve compatibility.
from jsquash.
@josephrocca Deno does seem to work with what I've played around with. I've added some examples in commit 60a959a.
Deno has yet to support the ImageData
API (denoland/deno#19288) so you'll need to polyfill that.
Let me know if you're still encountering issues and I can take a look 👍
from jsquash.
Thanks, Jamie! 🙏
from jsquash.
Related Issues (20)
- Oxipng multi-threaded mode fails when run from main thread.
- Export single thread only methods for codecs that have multi-threading. HOT 1
- Doesn't work in Vite SSR HOT 5
- Cannot find module in sveltekit project HOT 6
- Issues with multi-threaded worker modules and Vite HOT 13
- Basic Node.js Support HOT 1
- Provide way to override WASM file location HOT 2
- Deno fails with "NotSupported: Classic workers are not supported." HOT 1
- Improve @jquash/avif decode speed HOT 6
- @jsquash/png fails to decode some images HOT 14
- Create a reference decode speed benchmark page HOT 1
- Module not found HOT 1
- gif support? HOT 1
- Add type declarations for all wasm files? HOT 5
- jpeg and webp fail to import inside web worker HOT 2
- Resize component memory leak HOT 7
- Nuxt build error: UMD and IIFE output formats are not supported for code-splitting builds. HOT 4
- Passing a custom fetch function
- background execution? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsquash.