coach icon indicating copy to clipboard operation
coach copied to clipboard

avoidScalingImages should ignore svg that doesn't have any width

Open DannyvanHolten opened this issue 6 years ago • 2 comments

As we use svg images on our website they autoscale to the width of the browser. They are size independent. But sitespeed sees them as scaled images. It should ignore those svg's in the score.

DannyvanHolten avatar Jul 02 '18 14:07 DannyvanHolten

Hi @DannyvanHolten! Could you please provide a url for a site where you see this, as well as the version of sitespeed.io/coach you're using. I tried this on a few sites, but couldn't replicate.

Thanks, /Tobias

tobli avatar Jul 04 '18 07:07 tobli

We're being bit by this on our main site, but have provided a separate easier to test page which exhibits this issue.

See https://www.theregister.com/Design/page/sitespeedio_bug.html

In it, there are five test cases:

  1. what we use on the main site - a SVG + PNG sized 340x63 and put in a 190x35 img (errors)
  2. shouldn't error but does! - a SVG + PNG sized 190x35 and put in a 190x35 img (errors, but most definitely shouldn't!)
  3. shouldn't error but does! - a SVG sized 190x35 and put in a 190x35 img (errors, but most definitely shouldn't)
  4. doesn't error, yay! - a PNG sized 190x35 and put in a 190x35 img (passes)
  5. errors - a PNG sized 340x63 and put in a 190x35 img (errors)

Unsure if this may help understanding what might be going wrong here.

I do wonder, though, whether the avoidScalingImages error makes any sense for SVGs.

mfontani avatar Apr 12 '21 13:04 mfontani