From 814ff2e01f83bb4e5ce6d643cf137489c03d7300 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Wed, 9 May 2012 21:27:32 +0100 Subject: [PATCH] 5.9.161 --- CHANGELOG.TXT | 2 ++ tcpdf.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 774b9fe..169cb81 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,5 +1,7 @@ 5.9.161 (2012-05-09) - A bug on XREF table was fixed (Bug ID: 3525051). + - Deprecated Imagick:clone was replaced. + - Method objclone() was fixed for PHP4. 5.9.160 (2012-05-03) - A bug on tcpdf_parser.php was fixed. diff --git a/tcpdf.php b/tcpdf.php index 215f351..fe366eb 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -8413,7 +8413,7 @@ class TCPDF { $img = new Imagick(); $img->readImage($file); // clone image object - $imga = $img->clone(); + $imga = $this->objclone($img); // extract alpha channel $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); $img->negateImage(true); @@ -26468,7 +26468,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: * @since 4.5.029 (2009-03-19) */ public function objclone($object) { - return @clone($object); + // clone is defined only in PHP 5 + return (version_compare(phpversion(), '5.0') < 0) ? $object : clone($object); } /**