hello,
when running this code with image of 483x600px the analyse() returns ['topCrop' => NULL] :
$smartcrop = new xymak\image\smartcrop($file_img_resource, ['width' => 300, 'height' => 225]);
//Analyse the image and get the optimal crop scheme
$res = $smartcrop->analyse();
After some tests I could find out the analyse() returns this because generateCrops() returns null.
And generateCrops() returns null because $cropWidth = 301 instead of 300 and because of that it never enters the 3rd FOR.
And $cropWidth is that value because in canvasImageScale() the $this->options ['cropWidth'] is set to 301px.
What should be the best solution here?
Thanks.
hello,
when running this code with image of 483x600px the analyse() returns ['topCrop' => NULL] :
After some tests I could find out the analyse() returns this because generateCrops() returns null.
And generateCrops() returns null because $cropWidth = 301 instead of 300 and because of that it never enters the 3rd FOR.
And $cropWidth is that value because in canvasImageScale() the $this->options ['cropWidth'] is set to 301px.
What should be the best solution here?
Thanks.