From 78b589d3d8da157411389dd38fe42f2f23c444b0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 19 May 2023 02:37:35 +0000 Subject: [PATCH] test fixes + new test data --- tcpdf/tcpdf.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tcpdf/tcpdf.php b/tcpdf/tcpdf.php index 2e1a0c2..18f827e 100755 --- a/tcpdf/tcpdf.php +++ b/tcpdf/tcpdf.php @@ -7090,6 +7090,14 @@ class TCPDF { return $this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask); } } + + if (\is_file($tempfile_plain)) { + \unlink($tempfile_plain); + } + + if (\is_file($tempfile_alpha)) { + \unlink($tempfile_alpha); + } } if ($newimage) { //First use of image, get info @@ -7396,6 +7404,14 @@ class TCPDF { $imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false); // embed image, masked with previously embedded mask $this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask); + + if (\is_file($tempfile_plain)) { + \unlink($tempfile_plain); + } + + if (\is_file($tempfile_alpha)) { + \unlink($tempfile_alpha); + } } /** @@ -8429,7 +8445,7 @@ class TCPDF { $annots .= ' /Name /Note'; } $hasStateModel = isset($pl['opt']['statemodel']); - $hasState = isset($pl['opt']['state']); + $hasState = isset($pl['opt']['state']); $statemodels = ['Marked', 'Review']; if (!$hasStateModel && !$hasState) { break;