Inconsistency while cropping images
Samarkial opened this issue · comments
I get different results while cropping the same image at differents
Resulting files
25x25 :
32x32 :
35x35 :
40x40 :
I have other images with the same behavior, but not necessarely at the same size ( One crops bad at 24, but is fine at 23 and under as well as 25 and above).
This is from Nodejs (v.6.11.1) using the npm smartcrop-sharp (v.1.0.5)
Hi Samarkial,
The inconsistency comes from the fact that smartcrop scales the image down do the expected output image size before evaluating the crops. This can lead to odd results with small images and long processing times for large images. I changed this behavior for 2.0 (beta):
https://github.com/jwagner/smartcrop.js/pull/60/files
As I didn't spend much time working on smartcrop in the past year this hasn't been released or tested yet. But if you feel like it you can give it a go of course. I would appreciate your feedback.
Cheers,
Jonas
Should be fixed now.