ResponsiveFilemanager icon indicating copy to clipboard operation
ResponsiveFilemanager copied to clipboard

Deprecated error under PHP 8.1.5

Open jshster opened this issue 2 years ago • 2 comments

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

jshster avatar Aug 24 '22 02:08 jshster

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?

jshster avatar Aug 24 '22 02:08 jshster

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'];

cfconsultancy avatar Nov 28 '22 13:11 cfconsultancy