Skip to content

Commit

Permalink
Update Image.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisnikoy committed Apr 23, 2024
1 parent 33218a7 commit c7ec874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static function resizeImage($originalFile, $newWidth = null, $newHeight =
return false;
}

$newImg = imagecreatetruecolor($newWidth, $newHeight);
$newImg = imagecreatetruecolor(intval($newWidth), intval($newHeight));

if ($type == IMAGETYPE_GIF || $type == IMAGETYPE_PNG) {
imagecolortransparent(
Expand All @@ -60,7 +60,7 @@ public static function resizeImage($originalFile, $newWidth = null, $newHeight =
imagesavealpha($newImg, true);
}

imagecopyresampled($newImg, $srcImg, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
imagecopyresampled($newImg, $srcImg, 0, 0, 0, 0, intval($newWidth), intval($newHeight), $width, $height);


switch ($type) {
Expand Down

0 comments on commit c7ec874

Please sign in to comment.