From 5c830a5d1f6002850f57d6d8ca05e1fb365d83a4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 24 Sep 2023 03:50:15 +0000 Subject: [PATCH] test fixes --- Models/Label.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Models/Label.php b/Models/Label.php index 34f8f22..233bfe6 100644 --- a/Models/Label.php +++ b/Models/Label.php @@ -126,7 +126,12 @@ class Label return null; } - \imagecolortransparent($newIn, \imagecolorallocatealpha($newIn, 0, 0, 0, 127)); + $transparency = \imagecolorallocatealpha($newIn, 0, 0, 0, 127); + if ($transparency === false) { + return null; + } + + \imagecolortransparent($newIn, $transparency); \imagealphablending($newIn, false); \imagesavealpha($newIn, true); @@ -147,6 +152,9 @@ class Label } $cut = \imagecreatetruecolor($srcW, $srcH); + if ($cut === false) { + return null; + } \imagecopy($cut, $im, 0, 0, $element->x, $element->y, $srcW, $srcH); \imagecopy($cut, $in, 0, 0, 0, 0, $srcW, $srcH);