From 29eac4dd8ce9f35f3405ba68bfc099ad1a84f8b9 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 10 Feb 2018 16:31:24 +0100 Subject: [PATCH] Use `(int)` for "internal casts" See #2534 --- .../lib/system/image/adapter/GDImageAdapter.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php index 22a2e1fc8f..be91257f93 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php @@ -154,9 +154,9 @@ class GDImageAdapter implements IImageAdapter { } // resize image - $image = imagecreatetruecolor(intval($width), intval($height)); + $image = imagecreatetruecolor((int) $width, (int) $height); imagealphablending($image, false); - imagecopyresampled($image, $this->image, 0, 0, intval($x), intval($y), intval($width), intval($height), intval($sourceWidth), intval($sourceHeight)); + imagecopyresampled($image, $this->image, 0, 0, (int) $x, (int) $y, (int) $width, (int) $height, (int) $sourceWidth, (int) $sourceHeight); imagesavealpha($image, true); return $image; @@ -169,7 +169,7 @@ class GDImageAdapter implements IImageAdapter { $image = imagecreatetruecolor($width, $height); imagealphablending($image, false); - imagecopy($image, $this->image, 0, 0, intval($originX), intval($originY), intval($width), intval($height)); + imagecopy($image, $this->image, 0, 0, (int) $originX, (int) $originY, (int) $width, (int) $height); imagesavealpha($image, true); // reload image to update image resource, width and height @@ -183,7 +183,7 @@ class GDImageAdapter implements IImageAdapter { $image = imagecreatetruecolor($targetWidth, $targetHeight); imagealphablending($image, false); - imagecopyresampled($image, $this->image, 0, 0, intval($originX), intval($originY), intval($targetWidth), intval($targetHeight), intval($originWidth), intval($originHeight)); + imagecopyresampled($image, $this->image, 0, 0, (int) $originX, (int) $originY, (int) $targetWidth, (int) $targetHeight, (int) $originWidth, (int) $originHeight); imagesavealpha($image, true); // reload image to update image resource, width and height -- 2.20.1