respimagelint icon indicating copy to clipboard operation
respimagelint copied to clipboard

Image widths modified by object-fit don’t get detected correctly

Open ausi opened this issue 4 years ago • 0 comments

Any value for the CSS property object-fit other than fill can result in an image width that differs from img.clientWidth in https://github.com/ausi/respimagelint/blob/50165774844675cae2c8adbfa35ff46204847621/src/collector/readDimensions.js#L168

This property should be taken into account.

Sadly, there seems to be no JavaScript API for accessing the actual display image size inside the <img> if object-fit is used.

ausi avatar Jul 13 '21 23:07 ausi