ResponsiveFilemanager
ResponsiveFilemanager copied to clipboard
Deprecated error under PHP 8.1.5
I have fixed this in my local machine but there is a deprecated error that appears depending on the image sizes when displaying the file manager window.
Deprecated: Implicit conversion from float 15.5 to int loses precision in ***\filemanager\include\php_image_magician.php on line 492
Further info... it's when the system creates the thumbnails only. Relates to the call to imagecopyresampled() From what I can see it's the CropStartX value that is a float but the imagecopyresampled method expects an int.
I fixed it locally by modifying the call to: imagecopyresampled($crop, $this->imageResized, 0, 0, ceil($cropStartX), ceil($cropStartY), ceil($newWidth), ceil($newHeight), ceil($newWidth), ceil($newHeight));
Can probably debate whether that should be ceil() or floor(). Thoughts?
Fix 8.1 ***\filemanager\include\php_image_magician.php
on line 486 and 487 find
$cropStartX = $cropArray['x'];
$cropStartY = $cropArray['y'];
change to
$cropStartX = (int)$cropArray['x'];
$cropStartY = (int)$cropArray['y'];