grafika
grafika copied to clipboard
imagecolorat(): x,y is out of bounds
Hi,
There's an error thrown by Gd Editor when using smart crop on portrait images when the provided width of crop is equal or larger to that of the original image.
ex:
$image; // width = 200px, height = 500px
$image->crop($image->getWidth(), $image->getHeight());
// -> throws error
When I crop with $image->getWidth() - 1
, it works, but then the image is 1px less than what I need
Also, it only does this with smart crop, other crop methods work.
Is it enough info? Cheers!
Though this package probably is not maintained anymore, to whom come here for the answer. Always use integer values for image dimension to avoid this problem. When assign expression values to image (explicitly or over methods like crop), use intval() over expressions.