We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9fbbdd5 + f0fd424 commit ec5e5b8Copy full SHA for ec5e5b8
src/Thumbhash.php
@@ -87,8 +87,8 @@ public function encode(mixed $input): string
87
$originalHeight = $data->height();
88
if ($originalWidth > $this->imageMaxSize || $originalHeight > $this->imageMaxSize) {
89
$scale = $this->imageMaxSize / max($originalWidth, $originalHeight);
90
- $newWidth = $originalWidth * $scale;
91
- $newHeight = $originalHeight * $scale;
+ $newWidth = (int) ($originalWidth * $scale);
+ $newHeight = (int) ($originalHeight * $scale);
92
$data = $data->scaleDown($newWidth, $newHeight)->encode()->toString();
93
} elseif ($input instanceof File) {
94
$data = $input->getContent();
0 commit comments