Closed a0s closed 3 months ago
This project, webp-wasm, is ONLY for use in Node.js on the server. The WASM sources were taken from Google's Squoosh and CONVERTED to work on Node.js land. If you are trying to load WebP images in the browser, then.....
(1) All major browsers now support WebP natively. See Can I Use for the support matrix. It's basically universal now. You should not need a WASM WebP library at all anymore on the client-side.
(2) If for some reason you cannot use the built-in browser WebP system, and you must load it using WASM, check out Squoosh: https://squoosh.app/ -- Source: https://github.com/GoogleChromeLabs/squoosh -- This is where I got the WebP WASM blobs, and their version works in the browser. Don't use my hacked one.
Got it. The reason why I need WASM WebP is because iOS Safari Canvas has a limit of 4096x4096. I need to process images that are much bigger. I've created a VirtualCanvas library that manages tiled images (every tile is OffscreenCanvas elements 4096x4096). Now, I need a way to stitch all tiles into one huge WebP file without using an intermediate OffscreenCanvas.
Ah, gotcha. I wish they'd increase that limit. Most phones nowadays could easily handle 16384x16384 or more.
How to use with browser? My setup is "vue3 vite typescript" What i get: