From: <var...@us...> - 2021-06-28 15:17:32
|
Revision: 10336 http://sourceforge.net/p/phpwiki/code/10336 Author: vargenau Date: 2021-06-28 15:17:30 +0000 (Mon, 28 Jun 2021) Log Message: ----------- lib/plugin/text2png.php: factor code Modified Paths: -------------- trunk/lib/plugin/text2png.php Modified: trunk/lib/plugin/text2png.php =================================================================== --- trunk/lib/plugin/text2png.php 2021-06-28 14:45:46 UTC (rev 10335) +++ trunk/lib/plugin/text2png.php 2021-06-28 15:17:30 UTC (rev 10336) @@ -86,8 +86,8 @@ $error_html = _("Sorry, this version of PHP cannot create PNG image files."); $error_html .= " "; $error_html .= _("See") . _(": "); - $link = HTML::a(array('href' => "https://www.php.net/manual/en/ref.image.php"), - "https://www.php.net/manual/en/ref.image.php") ; + $url = "https://www.php.net/manual/en/ref.image.php"; + $link = HTML::a(array('href' => $url), $url); return HTML::span(array('class' => 'error'), $error_html, $link); } } @@ -162,22 +162,19 @@ */ // get ready to draw + + $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); + $error_html .= " "; + $error_html .= _("See") . _(": "); + $url = "https://www.php.net/manual/en/function.imagecreate.php"; + $link = HTML::a(array('href' => $url), $url); + $s = imagettfbbox($fontsize, 0, $ttfont, $text); if ($s === false) { - $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); - $error_html .= " "; - $error_html .= _("See") . _(": "); - $link = HTML::a(array('href' => "https://www.php.net/manual/en/function.imagecreate.php"), - "https://www.php.net/manual/en/function.imagecreate.php") ; return HTML::span(array('class' => 'error'), $error_html, $link); } $im = imagecreate(abs($s[4]) + 20, abs($s[7]) + 10); if (empty($im)) { - $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); - $error_html .= " "; - $error_html .= _("See") . _(": "); - $link = HTML::a(array('href' => "https://www.php.net/manual/en/function.imagecreate.php"), - "https://www.php.net/manual/en/function.imagecreate.php") ; return HTML::span(array('class' => 'error'), $error_html, $link); } $rgb = $this->hexcolor($backcolor, array(255, 255, 255)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |