php-imagine / Imagine

PHP Object Oriented image manipulation library
https://imagine.readthedocs.io
Other
4.42k stars 530 forks source link

remove warning, Deprecated: Implicit conversion from float to int loses precision in PHP 8.2 #847

Closed anovsiradj closed 1 year ago

anovsiradj commented 1 year ago

remove deprecated message from php8.2

edit: i guest this PR related to #843 😳

Deprecated: Implicit conversion from float 345.5 to int loses precision in ...\vendor\imagine\imagine\src\Gd\Image.php on line 191

on https://github.com/php-imagine/Imagine/blob/6d5b83a403d17236ba3b7e52e3c2caf4e937d0f0/src/Gd/Image.php#L191 imagecopymerge() need dst_x and dst_y to be int.

but $start->getX() and $start->getY() could return float.

mlocati commented 1 year ago

Why ceil instead of round?

anovsiradj commented 1 year ago

hello, i have revert previous commit and adjust it based on https://github.com/php-imagine/Imagine/pull/843#discussion_r1143490195

edit: i have also run the test, the only error is gmagick, because there is no dll for php v8.1