From 4a7678a1ad47724e466af71163e6f1bd02273c7c Mon Sep 17 00:00:00 2001 From: nicolaasuni Date: Fri, 3 Jan 2014 19:11:14 +0000 Subject: [PATCH] 6.0.053 (2014-01-03) - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed. - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied. --- CHANGELOG.TXT | 4 ++++ README.TXT | 8 ++++---- composer.json | 2 +- include/tcpdf_fonts.php | 14 +++++++------- tcpdf.php | 27 ++++++++++++++------------- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 0496a98..8d7b789 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +6.0.053 (2014-01-03) + - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed. + - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied. + 6.0.052 (2013-12-12) - Bug #871 "Datamatrix coding" was fixed. diff --git a/README.TXT b/README.TXT index d4d0fbc..315380e 100644 --- a/README.TXT +++ b/README.TXT @@ -8,11 +8,11 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 6.0.052 -Release date: 2013-12-12 +Version: 6.0.053 +Release date: 2014-01-03 Author: Nicola Asuni -Copyright (c) 2002-2013: +Copyright (c) 2002-2014: Nicola Asuni Tecnick.com LTD www.tecnick.com @@ -67,7 +67,7 @@ Additional Documentation: http://www.tcpdf.org License: - Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD + Copyright (C) 2002-2014 Nicola Asuni - Tecnick.com LTD TCPDF is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/composer.json b/composer.json index 2048d1c..0cc9809 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "6.0.052", + "version": "6.0.053", "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 c282dc8..0061948 100644 --- a/include/tcpdf_fonts.php +++ b/include/tcpdf_fonts.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.0.052 + * @version 6.0.053 */ // 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.052 + * @version 6.0.053 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -2406,10 +2406,15 @@ class TCPDF { /** * Return the cell height * @param $fontsize (int) Font size in internal units + * @param $padding (boolean) If true add cell padding * @public */ - public function getCellHeight($fontsize) { - return round((($fontsize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']), 3); + public function getCellHeight($fontsize, $padding=TRUE) { + $height = ($fontsize * $this->cell_height_ratio); + if ($padding) { + $height += ($this->cell_padding['T'] + $this->cell_padding['B']); + } + return round($height, 3); } /** @@ -6221,11 +6226,7 @@ class TCPDF { } $this->adjustCellPadding($border); $lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border); - $height = $lines * $this->getCellHeight($this->FontSize); - if ($autopadding) { - // add top and bottom padding - $height += ($this->cell_padding['T'] + $this->cell_padding['B']); - } + $height = $this->getCellHeight(($lines * $this->FontSize), $autopadding); $this->cell_padding = $prev_cell_padding; $this->lasth = $prev_lasth; return $height; @@ -18670,7 +18671,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: break; } case 'img': { - if (isset($tag['attribute']['src'])) { + if (!empty($tag['attribute']['src'])) { if ($tag['attribute']['src']{0} === '@') { // data stream $tag['attribute']['src'] = '@'.base64_decode(substr($tag['attribute']['src'], 1));