diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index dfcab54..21acc74 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,6 @@ +4.6.011 (2009-05-18) + - Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation). + 4.6.010 (2009-05-17) - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null. - tag indent problem was fixed. diff --git a/README.TXT b/README.TXT index fdc77da..7d18eec 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 4.6.010 -Release date: 2009-05-17 +Version: 4.6.011 +Release date: 2009-05-18 Author: Nicola Asuni Copyright (c) 2001-2009: diff --git a/doc/classtrees_com-tecnick-tcpdf.html b/doc/classtrees_com-tecnick-tcpdf.html index 5e48861..cc0b3e0 100644 --- a/doc/classtrees_com-tecnick-tcpdf.html +++ b/doc/classtrees_com-tecnick-tcpdf.html @@ -45,7 +45,7 @@

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/TCPDF.html b/doc/com-tecnick-tcpdf/TCPDF.html index b32e95a..4e3bd54 100644 --- a/doc/com-tecnick-tcpdf/TCPDF.html +++ b/doc/com-tecnick-tcpdf/TCPDF.html @@ -74,7 +74,7 @@ Source Location: /tcpdf.php

Version:

@@ -588,7 +588,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - info@tecnick.com - version:  4.6.010 + version:  4.6.011 link:  http://www.tcpdf.org @@ -9343,7 +9343,7 @@ $coords)
-

method Image [line 4358]

+

method Image [line 4359]

@@ -9356,13 +9356,14 @@ $w = 0], [float $h = 0], [string $type = ''], [mixed $link = ''], [string -$align = ''], [mixed +$align = ''], [boolean $resize = false], [int $dpi = 300], [string $palign = ''], [boolean $ismask = false], [mixed $imgmask = false], [mixed -$border = 0]) +$border = 0], [boolean +$fitbox = false])

@@ -9428,9 +9429,9 @@ $border = 0]) Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: - mixed   + boolean   $resize   - If false do not resize, if true resize (reduce) the image to fit $w and $h (requires GD library), if null scale image dimensions to fit within the ($w,$h) box proportionally. + If true resize (reduce) the image to fit $w and $h (requires GD library). int   @@ -9456,6 +9457,11 @@ $border = 0]) mixed   $border   Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): + + + boolean   + $fitbox   + If true scale image dimensions proportionally to fit within the ($w, $h) box.

@@ -19157,7 +19163,7 @@ $file)

- Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/TCPDFBarcode.html b/doc/com-tecnick-tcpdf/TCPDFBarcode.html index 3d9ff48..a93701b 100644 --- a/doc/com-tecnick-tcpdf/TCPDFBarcode.html +++ b/doc/com-tecnick-tcpdf/TCPDFBarcode.html @@ -1368,7 +1368,7 @@ $type)

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/_barcodes.php.html b/doc/com-tecnick-tcpdf/_barcodes.php.html index 404bce9..fcd38c3 100644 --- a/doc/com-tecnick-tcpdf/_barcodes.php.html +++ b/doc/com-tecnick-tcpdf/_barcodes.php.html @@ -96,7 +96,7 @@ PHP class to creates array representations for common 1D barcodes to be used wit

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html index a3f73fe..413da14 100644 --- a/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html +++ b/doc/com-tecnick-tcpdf/_config---tcpdf_config.php.html @@ -507,7 +507,7 @@ Configuration file for TCPDF.




- Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/_htmlcolors.php.html b/doc/com-tecnick-tcpdf/_htmlcolors.php.html index 0f320c0..9745c9c 100644 --- a/doc/com-tecnick-tcpdf/_htmlcolors.php.html +++ b/doc/com-tecnick-tcpdf/_htmlcolors.php.html @@ -88,7 +88,7 @@ Array of WEB safe colors.




- Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/_tcpdf.php.html b/doc/com-tecnick-tcpdf/_tcpdf.php.html index e19f5eb..0c70d1c 100644 --- a/doc/com-tecnick-tcpdf/_tcpdf.php.html +++ b/doc/com-tecnick-tcpdf/_tcpdf.php.html @@ -73,7 +73,7 @@ This is a PHP class for generating PDF documents without requiring external exte author:  Nicola Asuni - version:  4.6.010 + version:  4.6.011 copyright:  2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com @@ -104,7 +104,7 @@ unicode data

- PDF_PRODUCER = 'TCPDF 4.6.010 (http://www.tcpdf.org)' + PDF_PRODUCER = 'TCPDF 4.6.011 (http://www.tcpdf.org)'
@@ -115,7 +115,7 @@ unicode data


- Documentation generated on Sun, 17 May 2009 21:39:15 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:05 +0200 by phpDocumentor 1.4.1
diff --git a/doc/com-tecnick-tcpdf/_unicode_data.php.html b/doc/com-tecnick-tcpdf/_unicode_data.php.html index 2ec0168..1dc70ca 100644 --- a/doc/com-tecnick-tcpdf/_unicode_data.php.html +++ b/doc/com-tecnick-tcpdf/_unicode_data.php.html @@ -237,7 +237,7 @@ Unicode Include file for TCPDF.




- Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by phpDocumentor 1.4.1
diff --git a/doc/elementindex.html b/doc/elementindex.html index cca4a5d..2f00d69 100644 --- a/doc/elementindex.html +++ b/doc/elementindex.html @@ -1364,7 +1364,7 @@ top

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/elementindex_com-tecnick-tcpdf.html b/doc/elementindex_com-tecnick-tcpdf.html index a970b78..a1fa1f1 100644 --- a/doc/elementindex_com-tecnick-tcpdf.html +++ b/doc/elementindex_com-tecnick-tcpdf.html @@ -1387,7 +1387,7 @@ top

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/errors.html b/doc/errors.html index 9e87c65..a12b96b 100644 --- a/doc/errors.html +++ b/doc/errors.html @@ -35,7 +35,7 @@ Post-parsing

- Documentation generated on Sun, 17 May 2009 21:39:20 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:11 +0200 by phpDocumentor 1.4.1
diff --git a/doc/index.html b/doc/index.html index 1092a68..300f6da 100644 --- a/doc/index.html +++ b/doc/index.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/doc/li_com-tecnick-tcpdf.html b/doc/li_com-tecnick-tcpdf.html index 1092a68..300f6da 100644 --- a/doc/li_com-tecnick-tcpdf.html +++ b/doc/li_com-tecnick-tcpdf.html @@ -58,7 +58,7 @@ This documentation was generated by phpDocumentor v1.4.1

- Documentation generated on Sun, 17 May 2009 21:39:14 +0200 by phpDocumentor 1.4.1 + Documentation generated on Mon, 18 May 2009 20:13:04 +0200 by phpDocumentor 1.4.1
diff --git a/tcpdf.php b/tcpdf.php index ead9b2a..b3e4abf 100755 --- a/tcpdf.php +++ b/tcpdf.php @@ -2,9 +2,9 @@ //============================================================+ // File name : tcpdf.php // Begin : 2002-08-03 -// Last Update : 2009-05-17 +// Last Update : 2009-05-18 // Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org -// Version : 4.6.010 +// Version : 4.6.011 // License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) // ---------------------------------------------------------------------------- // Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. @@ -126,7 +126,7 @@ * @copyright 2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 4.6.010 + * @version 4.6.011 */ /** @@ -150,14 +150,14 @@ if (!class_exists('TCPDF', false)) { /** * define default PDF document producer */ - define('PDF_PRODUCER', 'TCPDF 4.6.010 (http://www.tcpdf.org)'); + define('PDF_PRODUCER', 'TCPDF 4.6.011 (http://www.tcpdf.org)'); /** * This is a PHP class for generating PDF documents without requiring external extensions.
* 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.
* @name TCPDF * @package com.tecnick.tcpdf - * @version 4.6.010 + * @version 4.6.011 * @author Nicola Asuni - info@tecnick.com * @link http://www.tcpdf.org * @license http://www.gnu.org/copyleft/lesser.html LGPL @@ -4345,17 +4345,18 @@ if (!class_exists('TCPDF', false)) { * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. * @param mixed $link URL or identifier returned by AddLink(). * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be: - * @param mixed $resize If false do not resize, if true resize (reduce) the image to fit $w and $h (requires GD library), if null scale image dimensions to fit within the ($w,$h) box proportionally. + * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). * @param int $dpi dot-per-inch resolution used on resize * @param string $palign Allows to center or align the image on the current line. Possible values are: * @param boolean $ismask true if this image is a mask, false otherwise * @param mixed $imgmask image object returned by this function or false * @param mixed $border Indicates if borders must be drawn around the image. The value can be either a number:or a string containing some or all of the following characters (in any order): + * @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box. * @return image information * @access public * @since 1.1 */ - public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0) { + public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false) { if ($x === '') { $x = $this->x; } @@ -4383,14 +4384,13 @@ if (!class_exists('TCPDF', false)) { $w = $h * $pixw / $pixh; } elseif ($h <= 0) { $h = $w * $pixh / $pixw; - } elseif (($w > 0) AND ($h > 0) AND is_null($resize)) { - // scale image dimensions to fit within the ($w, $h) box proportionally without resampling the image - if ($pixw >= $pixh) { + } elseif ($fitbox AND ($w > 0) AND ($h > 0)) { + // scale image dimensions proportionally to fit within the ($w, $h) box + if ((($w * $pixh) / ($h * $pixw)) < 1) { $h = $w * $pixh / $pixw; } else { $w = $h * $pixw / $pixh; } - $resize = false; } // calculate new minimum dimensions in pixels $neww = round($w * $this->k * $dpi / $this->dpi);