grafika icon indicating copy to clipboard operation
grafika copied to clipboard

imagecolorat(): x,y is out of bounds

Open tasinttttttt opened this issue 6 years ago • 1 comments

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!

tasinttttttt avatar Oct 24 '18 14:10 tasinttttttt

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.

JalalJaberi avatar Jan 12 '20 00:01 JalalJaberi