DivaVocals / zen_Image-Handler

Image Handler 4 is really meant to ease the management of product images (particularly the management of additional product images), and to help improve page performance by optimizing the product images.
GNU General Public License v2.0
7 stars 13 forks source link

bmz_image_handler.class.php casting in calculate_gravity #247

Closed torvista closed 2 years ago

torvista commented 2 years ago

php8, strict reporting

PHP Fatal error: Uncaught TypeError: imagecopy(): Argument #3 ($dst_x) must be of type int, float given in includes\classes\bmz_image_handler.class.php:798

in calculate_gravity, this sometimes returns a float as the int is only on the subtraction, not the division.

$startheight = (int)($canvasheight - $overlayheight) / 2;
$startwidth = (int)($canvaswidth - $overlaywidth) / 2;

so subsequently this gets to imagecopy