diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index f4e505d..c8deaf8 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +5.9.206 (2013-02-22) + - Bug item #754 "PNG with alpha channel becomes gray scale" was fixed. + - Minor documentation fixes. + 5.9.205 (2013-02-06) - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method. - PDF417 barcode bug was fixed. diff --git a/README.TXT b/README.TXT index e271017..7f9cbb2 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.205 -Release date: 2013-02-06 +Version: 5.9.206 +Release date: 2013-02-22 Author: Nicola Asuni Copyright (c) 2002-2013: diff --git a/composer.json b/composer.json index f1644c1..4cc4c8f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "5.9.205", + "version": "5.9.206", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/tcpdf.php b/tcpdf.php index 0ac75d7..e6b950e 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.205 + * @version 5.9.206 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -151,7 +151,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.205 + * @version 5.9.206 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -162,7 +162,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.205'; + private $tcpdf_version = '5.9.206'; // Protected properties @@ -5098,13 +5098,14 @@ class TCPDF { * @since 4.0.013 (2008-07-28) */ protected function getFontsList() { - $fontsdir = opendir($this->_getfontpath()); - while (($file = readdir($fontsdir)) !== false) { - if (substr($file, -4) == '.php') { - array_push($this->fontlist, strtolower(basename($file, '.php'))); + if (($fontsdir = opendir($this->_getfontpath())) !== false) { + while (($file = readdir($fontsdir)) !== false) { + if (substr($file, -4) == '.php') { + array_push($this->fontlist, strtolower(basename($file, '.php'))); + } } + closedir($fontsdir); } - closedir($fontsdir); } /** @@ -8706,12 +8707,20 @@ class TCPDF { // clone image object $imga = $this->objclone($img); // extract alpha channel - $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); - $img->negateImage(true); + if (method_exists($img, 'setImageAlphaChannel') AND defined('Imagick::ALPHACHANNEL_EXTRACT')) { + $img->setImageAlphaChannel(Imagick::ALPHACHANNEL_EXTRACT); + } else { + $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); + $img->negateImage(true); + } $img->setImageFormat('png'); $img->writeImage($tempfile_alpha); // remove alpha channel - $imga->separateImageChannel(39); // 39 = (imagick::CHANNEL_ALL & ~(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE)); + if (method_exists($imga, 'setImageMatte')) { + $imga->setImageMatte(false); + } else { + $imga->separateImageChannel(39); // 39 = (imagick::CHANNEL_ALL & ~(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE)); + } $imga->setImageFormat('png'); $imga->writeImage($tempfile_plain); } elseif (function_exists('imagecreatefrompng')) { // GD extension @@ -22336,6 +22345,9 @@ class TCPDF { * Prints a cell (rectangular area) with optional borders, background color and html text string. * The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
* If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. + * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul + * NOTE: all the HTML attributes must be enclosed in double-quote. * @param $w (float) Cell width. If 0, the cell extends up to the right margin. * @param $h (float) Cell minimum height. The cell extends automatically if needed. * @param $x (float) upper-left corner X coordinate @@ -22359,6 +22371,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: * Allows to preserve some HTML formatting (limited support).
* IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul + * NOTE: all the HTML attributes must be enclosed in double-quote. * @param $html (string) text to display * @param $ln (boolean) if true add a new line after text (default = true) * @param $fill (boolean) Indicates if the background must be painted (true) or transparent (false).