fix : Warning: Undefined array key height in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/core/lib/pdf.lib.php on line 2513

This commit is contained in:
Philippe GRAND 2023-02-26 11:12:06 +01:00
parent cbb6ca071a
commit 014aec72c2

View File

@ -2510,6 +2510,8 @@ function pdf_getSizeForImage($realpath)
$maxheight = (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT) ? 32 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT);
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$tmp = dol_getImageSize($realpath);
$width = 0;
$height = 0;
if ($tmp['height']) {
$width = (int) round($maxheight * $tmp['width'] / $tmp['height']); // I try to use maxheight
if ($width > $maxwidth) { // Pb with maxheight, so i use maxwidth