This commit is contained in:
Laurent Destailleur 2020-02-03 06:28:04 +01:00
parent d8ed62ea33
commit 87f84e5b17
2 changed files with 46 additions and 3 deletions

View File

@ -63,10 +63,49 @@ with
if (isset($this->imagekeys)) { if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) { foreach($this->imagekeys as $file) {
// unlink($file); // DOL CHANGE If we keep this, source image files are physically destroyed
// unlink($file);
} }
} }
* Replace in tcpdf.php
$preserve = array(
'file_id',
'internal_encoding',
'state',
'bufferlen',
'buffer',
'cached_files',
with
$preserve = array(
'file_id',
'internal_encoding',
'state',
'bufferlen',
'buffer',
'cached_files',
// @CHANGE DOL
'imagekeys',
* Replace in tcpdf.php
if (!@TCPDF_STATIC::file_exists($file)) {
return false;
}
with
if (!@TCPDF_STATIC::file_exists($file)) {
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
//return false;
}
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace * In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
if (strpos($filename, '://') === false) { if (strpos($filename, '://') === false) {

View File

@ -6878,7 +6878,9 @@ class TCPDF {
} }
// check if file exist and it is valid // check if file exist and it is valid
if (!@TCPDF_STATIC::file_exists($file)) { if (!@TCPDF_STATIC::file_exists($file)) {
return false; // DOL CHANGE If we keep this, the image is not visible on pages after the first one.
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
//return false;
} }
if (($imsize = @getimagesize($file)) === FALSE) { if (($imsize = @getimagesize($file)) === FALSE) {
if (in_array($file, $this->imagekeys)) { if (in_array($file, $this->imagekeys)) {
@ -7810,6 +7812,8 @@ class TCPDF {
'bufferlen', 'bufferlen',
'buffer', 'buffer',
'cached_files', 'cached_files',
// @CHANGE DOL
// 'imagekeys',
'sign', 'sign',
'signature_data', 'signature_data',
'signature_max_length', 'signature_max_length',