Fix syntax issue caught by Travis which happens only for php versions older than 5.6

This commit is contained in:
Hadi Nategh 2016-09-08 10:10:49 +02:00
parent 675731d74e
commit ea30baf1a3

View File

@ -41,7 +41,7 @@ class avatar
private static $_TEXT_COLOR = array (255, 255, 255); private static $_TEXT_COLOR = array (255, 255, 255);
// font path // font path
private static $_FONT_PATH = EGW_SERVER_ROOT.'/api/templates/default/fonts/arial.ttf'; private static $_FONT_PATH = '/api/templates/default/fonts/arial.ttf';
public function __construct() { public function __construct() {
} }
@ -96,14 +96,14 @@ class avatar
$fontsize = $_size / self::$_FONT_SIZE_RATIO; $fontsize = $_size / self::$_FONT_SIZE_RATIO;
$box = imagettfbbox($fontsize, 0, self::$_FONT_PATH, $text); $box = imagettfbbox($fontsize, 0, EGW_SERVER_ROOT.self::$_FONT_PATH, $text);
$x = floor(($_size - ($box[2] - $box[0]))/2); $x = floor(($_size - ($box[2] - $box[0]))/2);
$y = floor ($_size / self::$_TEXT_Y_RATIO); $y = floor ($_size / self::$_TEXT_Y_RATIO);
// write a ttf text // write a ttf text
$ttf = imagettftext($image, $fontsize, 0, $x, $y, $textcolor, self::$_FONT_PATH, $text); $ttf = imagettftext($image, $fontsize, 0, $x, $y, $textcolor, EGW_SERVER_ROOT.self::$_FONT_PATH, $text);
if ($ttf) if ($ttf)
{ {
ob_start(); ob_start();