jwagner / smartcrop.js

Content aware image cropping

Home Page:http://29a.ch/2014/04/03/smartcrop-content-aware-image-cropping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistency while cropping images

Samarkial opened this issue · comments

I get different results while cropping the same image at differents

The original file :
2

Resulting files

25x25 : 2_thumbnail_25x25
32x32 : 2_thumbnail_32x32
35x35 : 2_thumbnail_35x35
40x40 : 2_thumbnail_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.