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

View File

@ -63,10 +63,49 @@ with
if (isset($this->imagekeys)) {
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
if (strpos($filename, '://') === false) {
@ -102,7 +141,7 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
+ protected $default_monospaced_font = 'freemono';
TCPDI:
------

View File

@ -6878,7 +6878,9 @@ class TCPDF {
}
// check if file exist and it is valid
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 (in_array($file, $this->imagekeys)) {
@ -7810,6 +7812,8 @@ class TCPDF {
'bufferlen',
'buffer',
'cached_files',
// @CHANGE DOL
// 'imagekeys',
'sign',
'signature_data',
'signature_max_length',