imgbot / Imgbot

An Azure Function solution to crawl through all of your image files in GitHub and losslessly compress them. This will make the file size go down, but leave the dimensions and quality untouched. Once it's done, ImgBot will open a pull request for you to review and merge. help@imgbot.net
https://imgbot.net/
MIT License
1.23k stars 270 forks source link

SVGs are broken in aggressive mode #966

Open Twixes opened 2 years ago

Twixes commented 2 years ago

We used Imgbot on https://github.com/PostHog/posthog.com and recently enabled aggressive optimization to increase compression rates. Imgbot put out a PR with that aggressive optimization of images and it went well for raster images, but simply broke all our SVGs (PR https://github.com/PostHog/posthog.com/pull/1568/)

Default Aggressive
Good Bad

All the places where weirdly overflowing alt text is shown are SVG images in <img src="data:image/svg+xml;base64,{base64-encoded-svg-file}"> form.

GrigoreMihai commented 2 years ago

Can you provide some images for which this is happening for us to look into the issue, or is it happening for all the svgs from that pr ( https://github.com/PostHog/posthog.com/pull/1568 )?

Twixes commented 2 years ago

Certainly many, posthog-logo-svg.svg (at the top of the files list) seems to be one example there, but not sure if all.

VixieTSQ commented 2 years ago

if it at all helps the same thing happened to me. Here's my files Original Broken for temporary fix you can just add: "ignoredfiles": [ "*.svg" ] to your .imgbotconfig