image-ssim-js
image-ssim-js copied to clipboard
Demo: image scaling provides incorrect values
Since the demo page forces images into a square, the SSIM values end up being way different than if the images were evaluated on their original aspect ratio and size.
This PR...
- Uses canvas of the image's size and compares that.
- It adjusts CSS so the new canvas fits nicely in the block.
- And as two images with different sizes can no longer be tested against eachother, we alert the user to that error. :)
cc @patrickhulce
Before and after:
@patrickhulce in the meantime https://paulirish.github.io/image-ssim-js/test/browser_test.html has these changes live
ping?