Closed glodov closed 1 year ago
How can this error be reproduced?
$size
and $start
should always contain integer values.
How can this error be reproduced?
$size
and$start
should always contain integer values.
I just had it with PHP version 8. It seems some functions send numbers as string values.
I just had it with PHP version 8. It seems some functions send numbers as string values.
I was not able to reproduce that. How does your code in humhub/libs/ProfileImage.p... look like? Maybe the issue has its cause there.
I just had it with PHP version 8. It seems some functions send numbers as string values.
I was not able to reproduce that. How does your code in humhub/libs/ProfileImage.p... look like? Maybe the issue has its cause there.
I found this issue in HumHub project: https://www.humhub.com/. When you try to upload an image to your space and change the size and position it throws an error.
You can also try to pass a string as a number '8.123' or just float the number '8.123'. PHP8 is a strict language by default.
You can also try to pass a string as a number '8.123' or just float the number '8.123'.
I think I see the problem now:
$box = new Box('123.45', '123.45');
$point = new Point('123.45', '123.45');
var_dump($box->getWidth()); // int(123)
var_dump($point->getX()); // string(6) "123.45"
So I think this needs to be fixed in the Point
class similar to how it is handled in the Box
class: https://github.com/php-imagine/Imagine/blob/c10ea7f80e5b93473e2390515adc3057b85e26a2/src/Image/Box.php#L41-L46
thanks @ausi! @mlocati can you apply the pull request?
Superseeded by #847
Fix for The error is thrown in the HumHub project:
PHP Deprecated Warning 'yii\base\ErrorException' with message 'Implicit conversion from float-string "42.95454545454545" to int loses precision'
in /www/wwwroot/yta.yaro.info/protected/vendor/imagine/imagine/src/Imagick/Image.php:164
Stack trace:
0 [internal function]: yii\base\ErrorHandler->handleError() #1 /www/wwwroot/yta.yaro.info/protected/vendor/imagine/imagine/src/Imagick/Image.php(164): Imagick->cropImage() #2 /www/wwwroot/yta.yaro.info/protected/humhub/libs/ProfileImage.p...",