View Categories

I receive “Use explicit width and height on image elements” when testing with GTmetrix, why?

If you started using
ShortPixel Adaptive Images on your website and right after you installed it ran a GTMetrix test and you notice this error:

You should know that SPAI only replaces the URL of the image but it doesn’t touch the attributes of the
img tag. So, if your website is not adding the height and width attributes to the img tags, then GTmetrix will complain. 

Please notice that ShortPixel Adaptive Images already delivers the images with the correct dimensions, and it even adds a blank placeholder before the actual image is loaded so no layout shift happens, therefore you can safely ignore this warning.