-
Notifications
You must be signed in to change notification settings - Fork 101
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 WebP embedded in SVG #258
Comments
Hello, as you've probably seen, the SVG2 spec requires support for JPEG and PNG image formats: https://www.w3.org/TR/SVG2/conform.html#ConformingSVGViewers
Support for formats beyond these is optional, and there was some previous discussion about these within sharp at #226 I'm going to move this issue to the lovell/sharp-libvips repo for future possible consideration in the native prebuilt binaries. The WebAssembly build of sharp already does support WebP (and, I think, GIF) within SVG, so there's internal inconsistency within sharp. In the meantime, sharp supports the use of a globally-installed libvips, which if compiled with support for librsvg that is compiled with support for WebP. https://sharp.pixelplumbing.com/install#custom-libvips Finally, thank you very much for all your work on tsx, I've found myself using it many times (e.g. to deal with ESM-related problems) and it's always been a pleasure. |
Two legends! tsx and sharp! Thank you to you both! This is just an FYI. Maybe not too helpful in the context of this issue, but happy to provide more details if it is interesting. We use sharp in https://handle.me to convert our dynamically-built SVGs into NFT images on IPFS. Our users sometimes upload WebP images as part of this process. Switching to the WASM version worked great, BUT, the SVG paths that have CSS So in our case, we'd love to see WebP in the main npm build :) |
Feature request
What are you trying to achieve?
Embedding WebP in SVGs and converting that SVG to PNG or WebP
When you searched for similar feature requests, what did you find that might be related?
There are tests supporting PNGs embedding in SVGs:
https://github.com/lovell/sharp/blob/1533bf995acda779313fc178d2b9d46791349961/test/unit/svg.js#L116
What would you expect the API to look like?
No API change.
What alternatives have you considered?
Please provide sample image(s) that help explain this feature
N/A
The text was updated successfully, but these errors were encountered: