diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 943614f..401c5c7 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +5.9.146 (2012-02-12) + - Bug item #3486880 "$filehash undefine error" was fixed. + - The default font is now the one specified at PDF_FONT_NAME_MAIN constant. + 5.9.145 (2012-01-28) - Japanese language file was added. - TCPDF license and README.TXT files were updated. diff --git a/README.TXT b/README.TXT index f78081f..a22d72b 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.145 -Release date: 2012-01-28 +Version: 5.9.146 +Release date: 2012-02-12 Author: Nicola Asuni Copyright (c) 2002-2012: diff --git a/tcpdf.php b/tcpdf.php index 7ce0329..a9dabac 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.145 + * @version 5.9.146 */ // 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.145 + * @version 5.9.146 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -160,7 +160,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.145'; + private $tcpdf_version = '5.9.146'; // Protected properties @@ -1896,7 +1896,7 @@ class TCPDF { $this->gradients = array(); $this->InFooter = false; $this->lasth = 0; - $this->FontFamily = 'helvetica'; + $this->FontFamily = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica'; $this->FontStyle = ''; $this->FontSizePt = 12; $this->underline = false; @@ -3751,7 +3751,8 @@ class TCPDF { $this->y = $this->h - (1 / $this->k); $this->lMargin = 0; $this->_out('q'); - $this->SetFont('helvetica', '', 1); + $font = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica'; + $this->SetFont($font, '', 1); $this->setTextRenderingMode(0, false, false); $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67"; @@ -7579,6 +7580,8 @@ class TCPDF { $this->Error('[Image] Unable to get image: '.$file); } } + // file hash + $filehash = md5($file); // get original image width and height in pixels list($pixw, $pixh) = $imsize; // calculate image width and height on document @@ -7677,7 +7680,6 @@ class TCPDF { } } elseif (substr($file, 0, -34) != K_PATH_CACHE.'msk') { // check for cached images with alpha channel - $filehash = md5($file); $tempfile_plain = K_PATH_CACHE.'mskp_'.$filehash; $tempfile_alpha = K_PATH_CACHE.'mska_'.$filehash; if (in_array($tempfile_plain, $this->imagekeys)) {