diff --git a/images/doc/dossardposition.png b/images/doc/dossardposition.png index ace7961..1f3e528 100644 Binary files a/images/doc/dossardposition.png and b/images/doc/dossardposition.png differ diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index 7283225..bb7daae 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -9618,22 +9618,34 @@ function fxBibDistPrintWriteImage($pdf, $strPath, $fltMaxWMm = 0, $blnCenter = f $fltPageMax = $pdf->GetPageWidth() - $fltLeft - $fltRight; $fltMaxW = ($fltMaxWMm > 0) ? min($fltMaxWMm, $fltPageMax) : $fltPageMax; $tabSize = @getimagesize($strPath); + if (!is_array($tabSize) || empty($tabSize[0]) || empty($tabSize[1])) { + return; + } + + // FPDF se fie à l'extension : forcer le type réel (ex. JPEG nommé .png). + $strType = ''; + $strMime = isset($tabSize['mime']) ? strtolower((string)$tabSize['mime']) : ''; + if ($strMime === 'image/jpeg' || $strMime === 'image/jpg') { + $strType = 'JPG'; + } elseif ($strMime === 'image/png') { + $strType = 'PNG'; + } elseif ($strMime === 'image/gif') { + $strType = 'GIF'; + } else { + return; + } + $fltW = $fltMaxW; - if (is_array($tabSize) && !empty($tabSize[0]) && !empty($tabSize[1])) { - $fltNatW = ($tabSize[0] * 25.4) / 96; - if ($fltNatW > 0 && $fltNatW < $fltMaxW) { - $fltW = $fltNatW; - } - } - $fltH = 0; - if (is_array($tabSize) && !empty($tabSize[0]) && !empty($tabSize[1])) { - $fltH = $fltW * ($tabSize[1] / $tabSize[0]); + $fltNatW = ($tabSize[0] * 25.4) / 96; + if ($fltNatW > 0 && $fltNatW < $fltMaxW) { + $fltW = $fltNatW; } + $fltH = $fltW * ($tabSize[1] / $tabSize[0]); if ($pdf->GetY() + max(10, $fltH) > $pdf->GetPageHeight() - $fltBottom) { $pdf->AddPage(); } $fltX = $blnCenter ? (($pdf->GetPageWidth() - $fltW) / 2) : $pdf->GetX(); - $pdf->Image($strPath, $fltX, $pdf->GetY(), $fltW); + $pdf->Image($strPath, $fltX, $pdf->GetY(), $fltW, 0, $strType); $pdf->Ln(max(8, $fltH + 3)); }