From cb81ae3824f5d3105739365908147f0da0d13884 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 13 Oct 2011 09:05:17 +0200 Subject: [PATCH] 5.9.131 --- CHANGELOG.TXT | 3 +++ README.TXT | 4 ++-- tcpdf.php | 16 +++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index bb3f642..c71edf8 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +5.9.131 (2011-10-13) + - An error message was added to ImagePngAlpha() method. + 5.9.130 (2011-10-12) - Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata); diff --git a/README.TXT b/README.TXT index 542d0b9..aa83403 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.130 -Release date: 2011-10-12 +Version: 5.9.131 +Release date: 2011-10-13 Author: Nicola Asuni Copyright (c) 2002-2011: diff --git a/tcpdf.php b/tcpdf.php index 8b93e77..242301d 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.130 + * @version 5.9.131 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -149,7 +149,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.130 + * @version 5.9.131 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -160,7 +160,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.130'; + private $tcpdf_version = '5.9.131'; // Protected properties @@ -8213,7 +8213,7 @@ class TCPDF { $tempfile_plain = K_PATH_CACHE.'mskp_'.$filehash; // create temp alpha file $tempfile_alpha = K_PATH_CACHE.'mska_'.$filehash; - if (extension_loaded('imagick')) { // ImageMagick + if (extension_loaded('imagick')) { // ImageMagick extension // ImageMagick library $img = new Imagick(); $img->readImage($file); @@ -8228,7 +8228,7 @@ class TCPDF { $imga->separateImageChannel(39); // 39 = (imagick::CHANNEL_ALL & ~(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE)); $imga->setImageFormat('png'); $imga->writeImage($tempfile_plain); - } else { // GD library + } elseif (function_exists('imagecreatefrompng')) { // GD extension // generate images $img = imagecreatefrompng($file); $imgalpha = imagecreate($wpx, $hpx); @@ -8253,6 +8253,8 @@ class TCPDF { imagecopy($imgplain, $img, 0, 0, 0, 0, $wpx, $hpx); imagepng($imgplain, $tempfile_plain); imagedestroy($imgplain); + } else { + $this->Error('TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel.'); } // embed mask image $imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false);