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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jun 6, 2023

Conversation

anovsiradj
Copy link
Contributor

@anovsiradj anovsiradj commented Jun 5, 2023

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

if (imagecopymerge(/*dst_im*/$this->resource, /*src_im*/$image->resource, /*dst_x*/$start->getX(), /*dst_y*/$start->getY(), /*src_x*/0, /*src_y*/0, /*src_w*/$size->getWidth(), /*src_h*/$size->getHeight(), /*pct*/$alpha) === false) {

imagecopymerge() need dst_x and dst_y to be int.

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

remove deprecated message from php8.2

`Deprecated: Implicit conversion from float 345.5 to int loses precision in ...\vendor\imagine\imagine\src\Gd\Image.php on line 191`
@mlocati
Copy link
Collaborator

mlocati commented Jun 5, 2023

Why ceil instead of round?

src/Image/Point.php Outdated Show resolved Hide resolved
@anovsiradj
Copy link
Contributor Author

anovsiradj commented Jun 5, 2023

hello, i have revert previous commit and adjust it based on #843 (comment)

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

@mlocati mlocati merged commit b987af3 into php-imagine:develop Jun 6, 2023
21 checks passed
@mlocati mlocati mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants