webp-sh / webp_server_go

Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.
https://docs.webp.sh
GNU General Public License v3.0
1.79k stars 174 forks source link

image not found for .svg extention #257

Closed gotipath closed 1 year ago

gotipath commented 1 year ago

The website logo is in SVG format, Showing an error: "image not found". But the origin has this SVG. Can you guys suggest how can we solve this issue?

n0vad3v commented 1 year ago

Hmm, we currently doesn't support SVG as source image for optimization, as from Wikipedia(https://en.wikipedia.org/wiki/SVG)

Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation.

Could you please explain a bit more of your usage, like...are you trying to use WebP Server Go for all site's images that accidentally includes SVG?

BennyThink commented 1 year ago

SVG is a type of vector image format. This means SVG images are composed of mathematical equations (lines, curves, shapes) that define paths and fills.

I don't see why we should support conversion of SVG, because SVG images can be scaled up or down without losing any quality.

If could really be helpful if you can explain more.

gotipath commented 1 year ago

Can we just pass SVG images without compressing? Because all images and SVG icons are uploaded in the same S3 Bucket and that bucket we use as the origin of the WebP Server.

n0vad3v commented 1 year ago

@gotipath Seems you're using Proxy Mode, we've created PR https://github.com/webp-sh/webp_server_go/pull/258 that should fix this problem.

n0vad3v commented 1 year ago

We've released https://github.com/webp-sh/webp_server_go/releases/tag/0.9.8 that will fix this problem, you'll need to upgrade to that version and add svg to ALLOWED_TYPES in config.json to make it work.