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

Modified return type to avoid implicit float to int conversion #181

Merged

Conversation

diegomarty
Copy link
Contributor

To avoid deprecation log on implicit conversion, the method getCropPosition should always return int.

The function, imagecopyresampled, expects type int on parameters src_width and src_height .
https://www.php.net/manual/en/function.imagecopyresampled.php

Example deprecation log:

PHP message: PHP Deprecated:  Implicit conversion from float 472.5 to int loses precision in /vendor/gumlet/php-image-resize/lib/ImageResize.php on line 324'

PHP version: PHP 8.1.5 (cli) (built: May 3 2022 09:22:01) (NTS)

@adityapatadia adityapatadia merged commit 39066a3 into gumlet:master May 12, 2022
@adityapatadia
Copy link
Contributor

This is fixed in 2.0.2.

@diegomarty diegomarty deleted the fixed-return-getcropposition branch March 14, 2023 08:22
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

Successfully merging this pull request may close these issues.

2 participants