diff --git a/lib/dom/performance/avoidScalingImages.js b/lib/dom/performance/avoidScalingImages.js index 345d999..cf8b4f2 100644 --- a/lib/dom/performance/avoidScalingImages.js +++ b/lib/dom/performance/avoidScalingImages.js @@ -11,8 +11,10 @@ for (let i = 0, len = images.length; i < len; i++) { const img = images[i]; - // skip images that are 0 (carousel etc) - if (img.clientWidth + minLimit < img.naturalWidth && img.clientWidth > 0) { + const fileExtension = (new URL(img.currentSrc)).pathname.split('.').pop(); + + // skip svg images and images that are 0 (carousel etc) + if (fileExtension !== 'svg' && img.clientWidth + minLimit < img.naturalWidth && img.clientWidth > 0) { // message = message + ' ' + util.getAbsoluteURL(img.currentSrc) + ' [browserWidth:' + img.clientWidth + ' naturalWidth: ' + img.naturalWidth +']'; offending.push(util.getAbsoluteURL(img.currentSrc)); score += 10;