Skip to content

Commit

Permalink
fix(image-size-runtime.html): exclude SVG images from Perf: properly … (
Browse files Browse the repository at this point in the history
#6318)

fix(image-size-runtime.html): exclude SVG images from Perf: properly size image warnings

SVG is a vector format. Attributes like width, height & viewbox are not relevant to the size in
bytes of the image, so the Perf: properly size image warning is incorrect.
  • Loading branch information
williamsdyyz committed May 20, 2024
1 parent d78c13a commit a738299
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ <h2 id="title"></h2>
}
const realArea = info.width && info.height;
const threshholdArea = realArea * 0.5;
const tooBig = browserArea < threshholdArea;
const tooBig = browserArea < threshholdArea && info.type !== 'svg';
skip = false;
if (layoutInvalidation || tooBig) {
if (!overlay) {
Expand Down

0 comments on commit a738299

Please sign in to comment.