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

imagecopy float implicit conversion warning #13

Closed
marco-pm opened this issue Mar 15, 2023 · 0 comments
Closed

imagecopy float implicit conversion warning #13

marco-pm opened this issue Mar 15, 2023 · 0 comments
Labels
bug fix provided A correction has been provided
Milestone

Comments

@marco-pm
Copy link

$startwidth = (int)($this->canvas['width'] - $newwidth) / 2;
$startheight = (int)($this->canvas['height'] - $newheight) / 2;

[...]

imagecopy($newimg, $tmpimg, $startwidth, $startheight, 0, 0, $newwidth, $newheight);

On PHP 8.1+, if $startwidth or $startheight are float, imagecopy generates a Implicit conversion from float to int loses precision warning.

@lat9 lat9 added the bug label Mar 15, 2023
@lat9 lat9 added this to the v5.3.3 milestone Mar 15, 2023
@lat9 lat9 closed this as completed in 43f8fc5 Mar 15, 2023
lat9 added a commit that referenced this issue Mar 15, 2023
#13 - `imagecopy` float implicit conversion warning
@lat9 lat9 reopened this Mar 15, 2023
@lat9 lat9 added the fix provided A correction has been provided label Mar 15, 2023
@lat9 lat9 closed this as completed Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix provided A correction has been provided
Projects
None yet
Development

No branches or pull requests

2 participants