Skip to content

Commit ec5e5b8

Browse files
authored
Merge pull request #1 from me-shaon/fix/float-conversion-warning
fix: float conversion warning in intervention image package
2 parents 9fbbdd5 + f0fd424 commit ec5e5b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Thumbhash.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public function encode(mixed $input): string
8787
$originalHeight = $data->height();
8888
if ($originalWidth > $this->imageMaxSize || $originalHeight > $this->imageMaxSize) {
8989
$scale = $this->imageMaxSize / max($originalWidth, $originalHeight);
90-
$newWidth = $originalWidth * $scale;
91-
$newHeight = $originalHeight * $scale;
90+
$newWidth = (int) ($originalWidth * $scale);
91+
$newHeight = (int) ($originalHeight * $scale);
9292
$data = $data->scaleDown($newWidth, $newHeight)->encode()->toString();
9393
} elseif ($input instanceof File) {
9494
$data = $input->getContent();

0 commit comments

Comments
 (0)