Skip to content

Commit

Permalink
bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed May 22, 2024
1 parent 611f9af commit 96638bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/Actions/ImageResize.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function main(
): string {
[$width, $height] = getimagesize($file);
$targetWidth = self::FIT_WIDTH[$fit];
$targetHeight = $height / $width * $targetWidth;
$targetHeight = intval($height / $width * $targetWidth);
$image = imagecreatetruecolor($targetWidth, $targetHeight);
$source = imagecreatefromjpeg($file);
imagecopyresampled($image, $source, 0, 0, 0, 0, $targetWidth, $targetHeight, $width, $height);
Expand Down

0 comments on commit 96638bf

Please sign in to comment.