2
0
forked from Wavyzz/dolibarr

Qual: Use a shared function to define logo heigth.

Qual: Add more phpunit tests
Fix: This also solve overlapping logos.
This commit is contained in:
Laurent Destailleur
2012-04-01 23:57:15 +02:00
parent cf68414b21
commit 46251db167
18 changed files with 211 additions and 15 deletions

View File

@@ -168,6 +168,27 @@ function pdf_getPDFFontSize($outputlangs)
}
/**
* Return height to use for Logo onot PDF
*
* @param string $logo Full path to logo file to use
* @return number
*/
function pdf_getHeightForLogo($logo)
{
$height=22; $maxwidth=130;
include_once(DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php');
$tmp=dol_getImageSize($logo);
if ($tmp['height'])
{
$width=round($height*$tmp['width']/$tmp['height']);
if ($width > $maxwidth) $height=$height*$maxwidth/$width;
}
//print $tmp['width'].' '.$tmp['height'].' '.$width; exit;
return $height;
}
/**
* Return a string with full address formated
*