Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagecolorat(): x,y is out of bounds #17

Open
tasinttttttt opened this issue Oct 24, 2018 · 1 comment
Open

imagecolorat(): x,y is out of bounds #17

tasinttttttt opened this issue Oct 24, 2018 · 1 comment

Comments

@tasinttttttt
Copy link

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!

@JalalJaberi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants