Merge pull request #24055 from grandoc/new_branch_26_02_2023

fix : Warning: Undefined array key height in /home/httpd/vhosts/aflac…
This commit is contained in:
Laurent Destailleur 2023-02-26 19:22:06 +01:00 committed by GitHub
commit b01e72e8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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