From 52a029e80307d5d80f23a4c62adfd510891cb085 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Sat, 26 Oct 2024 11:33:55 +0100 Subject: [PATCH] bruno-farias: Fix count svg #647 --- tcpdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index eef39154..af5beb97 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -23445,8 +23445,8 @@ protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1 $cy -= $h; } $this->_out(sprintf('%F 0 0 %F %F %F cm', ($w * $this->k), ($h * $this->k), ($x * $this->k), ($cy * $this->k))); - if (count($gradient['stops']) > 1) { - $this->Gradient($gradient['type'], $gradient['coords'], $gradient['stops'], array(), false); + if ((is_array($gradient['stops']) || $gradient['stops'] instanceof Countable) && count($gradient['stops']) > 1) { + $this->Gradient($gradient['type'], $gradient['coords'], $gradient['stops']); } } elseif ($svgstyle['fill'] != 'none') { $fill_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['fill'], $this->spot_colors);