simon987/imagehash-web

image.naturalwidth/height vs image.width/height

Closed this issue · 1 comments

When referring to an image's size in an image element, the width will be the DOM width, whereas naturalWidth will be the image's actual width. This causes hashing differences if images are not drawn at 1:1 scale in the browser.

Workaround would be to copy the element and set the size of that element to the image's natural size

Oh good catch. I changed it so that it uses naturalWidth/height now in 2f21907