ausi / respimagelint

Linter for Responsive Images - https://ausi.github.io/respimagelint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with computation of "specified" width

nhoizey opened this issue · comments

I'm using the bookmarklet on https://nicolas-hoizey.com where I saw I had wrong sizes attribute values.

For the first image (my face 😅), I get this:
image

It says "The size of the image doesn’t match the sizes attribute (min-width: 66.7rem) 14.4rem, (min-width: 30rem) calc(22.5vw - .6rem), (min-width: 20rem) calc(30vw - .6rem), calc(45vw - .6rem). At a viewport of 1280x720 the image was 230.2 pixels wide instead of the specified 276 (-17% difference)."

"At a viewport of 1280x720" -> min-width: 66.7rem applies and the image width should be 14.4rem -> 230.4px with 1rem = 16rem (as I checked in my browser's settings)

So the reported "230.2 pixels" look great IMHO, and I don't understand where "the specified 276" comes from.

The other images in the page seem to have the same issue.

The linter wasn’t able to interpret rem values correctly. Should be fixed now.

@ausi it work now indeed, thanks! 🙏