From 23ce7ff380194d90d719af37a3a10940201af899 Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Fri, 23 May 2014 22:58:56 +0100 Subject: [PATCH] 6.0.082 (2014-05-23) - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed. - Bug item #925 "924 transparent images bug" was fixed. --- CHANGELOG.TXT | 4 ++++ README.TXT | 4 ++-- composer.json | 2 +- include/tcpdf_fonts.php | 8 ++++---- include/tcpdf_images.php | 4 +--- include/tcpdf_static.php | 2 +- tcpdf.php | 34 +++++++++++++++++++++++++++------- 7 files changed, 40 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 425033e..448f9aa 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +6.0.082 (2014-05-23) + - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed. + - Bug item #925 "924 transparent images bug" was fixed. + 6.0.081 (2014-05-22) - Bug item #922 "writehtml tables thead repeating" was fixed. - Patch #71 "External and internal links, local and remote" wa applied. diff --git a/README.TXT b/README.TXT index c69cc74..c4a83a4 100644 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.081 -Release date: 2014-05-22 +Version: 6.0.082 +Release date: 2014-05-23 Author: Nicola Asuni Copyright (c) 2002-2014: diff --git a/composer.json b/composer.json index e8c2c40..8a6197b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.081", + "version": "6.0.082", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/include/tcpdf_fonts.php b/include/tcpdf_fonts.php index 9301d15..a7f0486 100644 --- a/include/tcpdf_fonts.php +++ b/include/tcpdf_fonts.php @@ -1,9 +1,9 @@ 0) AND ($len < 80)) { + while ((ord(fread($f, 1)) != 0) AND ($len < 79)) { ++$len; } - // skip null separator - fread($f, 1); // get compression method if (ord(fread($f, 1)) != 0) { // Unknown filter method diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index fccc9d8..2492260 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.0.081'; + private static $tcpdf_version = '6.0.082'; /** * String alias for total number of pages. diff --git a/tcpdf.php b/tcpdf.php index 5480ebf..1b37fbb 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.081 + * @version 6.0.082 */ // TCPDF configuration @@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.0.081 + * @version 6.0.082 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -9191,10 +9191,30 @@ class TCPDF { if (isset($info['trns']) AND is_array($info['trns'])) { $trns = ''; $count_info = count($info['trns']); - for ($i=0; $i < $count_info; ++$i) { - $trns .= $info['trns'][$i].' '.$info['trns'][$i].' '; + if ($info['cs'] == 'Indexed') { + $maxval =(pow(2, $info['bpc']) - 1); + for ($i = 0; $i < $count_info; ++$i) { + if (($info['trns'][$i] != 0) AND ($info['trns'][$i] != $maxval)) { + // this is not a binary type mask @TODO: create a SMask + $trns = ''; + break; + } elseif (empty($trns) AND ($info['trns'][$i] == 0)) { + // store the first fully transparent value + $trns .= $i.' '.$i.' '; + } + } + } else { + // grayscale or RGB + for ($i = 0; $i < $count_info; ++$i) { + if ($info['trns'][$i] == 0) { + $trns .= $info['trns'][$i].' '.$info['trns'][$i].' '; + } + } + } + // Colour Key Masking + if (!empty($trns)) { + $out .= ' /Mask ['.$trns.']'; } - $out .= ' /Mask ['.$trns.']'; } $stream = $this->_getrawstream($info['data']); $out .= ' /Length '.strlen($stream).' >>';