5.9.181 (2012-08-31)

- composer.json file was added.
- Bug item #3563369 "Cached images are not unlinked some time" was fixed.
This commit is contained in:
Nicola Asuni 2012-08-31 21:13:21 +01:00
parent 184bbe0a4f
commit c47cad2bdd
4 changed files with 69 additions and 16 deletions

View File

@ -1,3 +1,7 @@
5.9.181 (2012-08-31)
- composer.json file was added.
- Bug item #3563369 "Cached images are not unlinked some time" was fixed.
5.9.180 (2012-08-22)
- Bug item #3560493 "Problems with nested cells in HTML" was fixed.

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.9.180
Release date: 2012-08-22
Version: 5.9.181
Release date: 2012-08-31
Author: Nicola Asuni
Copyright (c) 2002-2012:

38
composer.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": "tcpdf/tcpdf",
"version": "5.9.181",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions.",
"keywords": ["pdf"],
"license": "LGPLv3",
"authors": [
{
"name": "Nicola Asuni",
"email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com"
}
],
"require": {
"php": ">5.2"
},
"autoload": {
"classmap": [
"fonts",
"config/lang",
"config",
"2dbarcodes.php",
"barcodes.php",
"datamatrix.php",
"encodings_maps.php",
"htmlcolors.php",
"pdf417.php",
"qrcode.php",
"spotcolors.php",
"tcpdf.php",
"tcpdf_filters.php",
"tcpdf_parser.php",
"unicode_data.php"
]
}
}

View File

@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 5.9.180
// Version : 5.9.181
// Begin : 2002-08-03
// Last Update : 2012-08-22
// Last Update : 2012-08-31
// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3
// -------------------------------------------------------------------
@ -138,7 +138,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 5.9.180
* @version 5.9.181
*/
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -150,7 +150,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.<br>
* @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.180
* @version 5.9.181
* @author Nicola Asuni - info@tecnick.com
*/
class TCPDF {
@ -161,7 +161,7 @@ class TCPDF {
* Current TCPDF version.
* @private
*/
private $tcpdf_version = '5.9.180';
private $tcpdf_version = '5.9.181';
// Protected properties
@ -359,6 +359,12 @@ class TCPDF {
*/
protected $images = array();
/**
* Array of cached files.
* @protected
*/
protected $cached_files = array();
/**
* Array of Annotations in pages.
* @protected
@ -7849,7 +7855,6 @@ class TCPDF {
}
// check page for no-write regions and adapt page margins if necessary
list($x, $y) = $this->checkPageRegions($h, $x, $y);
$cached_file = false; // true when the file is cached
$exurl = ''; // external streams
// check if we are passing an image as file or string
if ($file[0] === '@') {
@ -7860,11 +7865,11 @@ class TCPDF {
fwrite($fp, $imgdata);
fclose($fp);
unset($imgdata);
$cached_file = true;
$imsize = @getimagesize($file);
if ($imsize === FALSE) {
unlink($file);
$cached_file = false;
} else {
$this->cached_files[] = $file;
}
} else { // image file
if ($file{0} === '*') {
@ -7908,11 +7913,11 @@ class TCPDF {
fwrite($fp, $imgdata);
fclose($fp);
unset($imgdata);
$cached_file = true;
$imsize = @getimagesize($file);
if ($imsize === FALSE) {
unlink($file);
$cached_file = false;
} else {
$this->cached_files[] = $file;
}
}
} elseif (($w > 0) AND ($h > 0)) {
@ -8172,10 +8177,6 @@ class TCPDF {
// add image to document
$this->setImageBuffer($file, $info);
}
if ($cached_file) {
// remove cached file
unlink($file);
}
// set alignment
$this->img_rb_y = $y + $h;
// set alignment
@ -9075,6 +9076,7 @@ class TCPDF {
AND ($val != 'bufferlen')
AND ($val != 'buffer')
AND ($val != 'diskcache')
AND ($val != 'cached_files')
AND ($val != 'sign')
AND ($val != 'signature_data')
AND ($val != 'signature_max_length')
@ -9085,6 +9087,15 @@ class TCPDF {
}
}
}
if (isset($this->cached_files) AND !empty($this->cached_files)) {
// remove cached files
foreach ($this->cached_files as $cachefile) {
if (is_file($cachefile)) {
unlink($cachefile);
}
}
unset($this->cached_files);
}
}
/**