diff --git a/src/image/Image.php b/src/image/Image.php index 6e54937f..8fda3850 100644 --- a/src/image/Image.php +++ b/src/image/Image.php @@ -773,7 +773,7 @@ public function _StrokeBuiltinFont($x, $y, $txt, $dir, $paragraph_align, &$aBoun } } else { //Put the text - imagestring($this->img, $use_font, $x, $y - $h + 1, $txt, $this->current_color); + imagestring($this->img, $use_font, intval($x), intval($y - $h + 1), $txt, intval($this->current_color)); } if ($aDebug) { // Draw the bounding rectangle and the bounding box @@ -1038,8 +1038,8 @@ public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, } } - $x = (int) round($x); - $y = (int) round($y); + $x = intval(round($x)); + $y = intval(round($y)); imagettftext( $this->img, @@ -1152,8 +1152,8 @@ public function _StrokeTTF($x, $y, $txt, $dir, $paragraph_align, &$aBoundingBox, $yl = $y - $yadj; //$xl = $xl- $xadj; - $xl = (int) round($xl); - $yl = (int) round($yl - ($h - $fh) + $fh * $i); + $xl = intval(round($xl)); + $yl = intval(round($yl - ($h - $fh) + $fh * $i)); imagettftext( $this->img, @@ -1608,7 +1608,7 @@ public function FilledPolygon($pts) } $old = $this->line_weight; imagesetthickness($this->img, 1); - imagefilledpolygon($this->img, $pts, safe_count($pts) / 2, $this->current_color); + imagefilledpolygon($this->img, $pts, $this->current_color); $this->line_weight = $old; imagesetthickness($this->img, $old); } @@ -1979,7 +1979,7 @@ public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color) $p4y = ceil(($y1 - $dist_y)); $array = [$p1x, $p1y, $p2x, $p2y, $p3x, $p3y, $p4x, $p4y]; - imagefilledpolygon($im, $array, (safe_count($array) / 2), $color); + imagefilledpolygon($im, $array, $color); // for antialias imageline($im, $p1x, $p1y, $p2x, $p2y, $color); @@ -2042,7 +2042,7 @@ public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color) } imagesetthickness($im, 1); - imagefilledpolygon($im, $pts, safe_count($pts) / 2, $color); + imagefilledpolygon($im, $pts, $color); $weight *= 2; diff --git a/src/util/DateLocale.php b/src/util/DateLocale.php index bf8c6801..3e534c19 100644 --- a/src/util/DateLocale.php +++ b/src/util/DateLocale.php @@ -57,15 +57,15 @@ public function Set($aLocale) } $this->iLocale = $aLocale; - for ($i = 0, $ofs = 0 - strftime('%w'); $i < 7; $i++, $ofs++) { - $day = strftime('%a', strtotime("${ofs} day")); + for ($i = 0, $ofs = 0 - date('w'); $i < 7; $i++, $ofs++) { + $day = date('D', strtotime("${ofs} day")); $day[0] = strtoupper($day[0]); $this->iDayAbb[$aLocale][] = $day[0]; $this->iShortDay[$aLocale][] = $day; } for ($i = 1; $i <= 12; ++$i) { - list($short, $full) = explode('|', strftime('%b|%B', strtotime("2001-${i}-01"))); + list($short, $full) = explode('|', date('M|F', strtotime("2001-${i}-01"))); $this->iShortMonth[$aLocale][] = ucfirst($short); $this->iMonthName[$aLocale][] = ucfirst($full); }