Gregwar / Image

A PHP library to handle images
MIT License
1k stars 191 forks source link

Deprecated: Implicit conversion from float 768.1159420289855 to int loses precision #187

Open WelshDev opened 1 year ago

WelshDev commented 1 year ago

I'm using gregwar/image "2.1.0" in a Symfony PHP 8.1 app and I'm getting the following exception...

Deprecated: Implicit conversion from float 768.1159420289855 to int loses precision

In my code I'm calling..

$img->save($absoluteDir . $outputDirectory . '/' . $newName, 'jpg', 90);

And I believe the exception is being thrown in "/vendor/gregwar/image/Gregwar/Image/Adapter/GD.php" on line 90...

imagecopyresampled($n, $this->resource, ($target_width - $new_width) / 2, ($target_height - $new_height) / 2, 0, 0, $new_width, $new_height, $width, $height);

Thanks