fix image resize when width to height is large

This commit is contained in:
Yurii
2026-02-06 10:26:34 +02:00
parent 229e8f2ae0
commit 22cbfb669c
+6 -2
View File
@@ -267,8 +267,12 @@ class Image implements EntryPoint
}
}
if ($targetWidth < 1 || $targetHeight < 1) {
throw new RuntimeException("No width or height.");
if ($targetWidth < 1) {
$targetWidth = 1;
}
if ($targetHeight < 1) {
$targetHeight = 1;
}
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);