From 22cbfb669cd99cc93c1f150b864e8c2e0ee7c72a Mon Sep 17 00:00:00 2001 From: Yurii Date: Fri, 6 Feb 2026 10:26:34 +0200 Subject: [PATCH] fix image resize when width to height is large --- application/Espo/EntryPoints/Image.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/Espo/EntryPoints/Image.php b/application/Espo/EntryPoints/Image.php index 8f1d0af583..7eb12269b9 100644 --- a/application/Espo/EntryPoints/Image.php +++ b/application/Espo/EntryPoints/Image.php @@ -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);