Skip to content
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

SVG source format doesn't work with WEBP_DETECTION and AVIF_DETECTION #1251

Open
Frezyy123 opened this issue Mar 5, 2024 · 2 comments
Open

Comments

@Frezyy123
Copy link
Contributor

Hi, I am facing with some undocumented behaviour
If I have svg image as a source and enable all features with AVIF/WebP support detection, svg image will not be processed and imgproxy return svg image.

Looks like it skips everytime, when we have svg source image with missing extension

if originData.Type == po.Format || po.Format == imagetype.Unknown {
// Don't process SVG
if originData.Type == imagetype.SVG {
if config.SanitizeSvg {

So, everytime, when I have svg source, I need to add any extension, just to force this feature with detection. For example
https://example.com/image returns svg image
https://example.com/image@jpeg returns in respect of accept header, webp or avif

Could you please explain to me, why it works like this? Is there any problem with conversion svg?

@DarthSim
Copy link
Member

DarthSim commented Mar 5, 2024

Hey @Frezyy123!

SVGs are not rasterized unless the resulting format is explicitly specified. In the vast majority of cases rasterizing SVG doesn't bring any benefit. The only case I know where it makes sense is email.

However, having a rasterize_svg option may be useful 🤔

@Frezyy123
Copy link
Contributor Author

In some cases svg icon is much more easier to draw, but iOS application have troubles with svg and choose webp format (or pdf but this is really bad way :))

I will try to implement this option and bring pull request to you
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants