ID:               34733
 User updated by:  mhinck at suscom dot net
 Reported By:      mhinck at suscom dot net
-Status:           Feedback
+Status:           Closed
 Bug Type:         GD related
 Operating System: Fedora Core 2
 PHP Version:      5.0.5
 Assigned To:      pajoye
 New Comment:

The 5.1 snapshot you linked worked.  I had only tried the 5.0.  Thanks.


Previous Comments:
------------------------------------------------------------------------

[2005-10-04 21:09:54] [EMAIL PROTECTED]

And provide a short script without extern data.

In your case 3-4 lines, create the image draw some text save the
image.

Please try with the bundled GD ("./configure --with-gd") as well.

------------------------------------------------------------------------

[2005-10-04 18:28:35] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-10-04 16:37:55] mhinck at suscom dot net

Description:
------------
After upgrading from 5.0.2 to 5.0.5 the x coordinate in the imageFTText
is doing nothing.  All other arguments work as expected but the x
coordinate is ignored.  Example uses arial but tried with many fonts
with same result.  GD is version 2.0.28.  Following config ran without
issue:

./configure --with-apxs2=/usr/local/apache2/bin/apxs
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-mysql=/usr/local/mysql/  --with-t1lib=/usr/local/lib
--enable-fast-cgi --enable-magic-quotes --with-openssl --enable-sockets
--enable-debug --with-zlib  --with-cyrus --enable-exif --with-gd=/usr
--with-freetype-dir=/usr/local --enable-calendar --with-gettext
--with-xml --enable-dom --with-iconv --enable-mbstring
--with-mbstring=all --with-kerberos --with-mcrypt --with-cyrus
--with-imap --with-imap-ssl --with-mcal=/usr/lib  --with-ldap
--with-ldap-sasl


Reproduce code:
---------------
<?php

$im = LoadPNG("blank.png"); //A straight white png file.
imagecolortransparent ($im, imagecolorat ($im, 0, 0));
$font = "/usr/X11R6/lib/X11/fonts/TTF/arial.ttf";
$txtcr = imagecolorallocate($im, 0, 0, 0); ;
$tbb = imageFTText ($im, 12, 0, 50, 25, $txtcr, $font, "testing",
array());

header ("Content-type: image/png");
imagePNG($im);
imagedestroy ($im);

function LoadPNG ($imgname) {
   $im = @imagecreatefrompng ($imgname); /* Attempt to open */
   if (!$im) { /* See if it failed */
       $im  = imagecreate (150, 30); /* Create a blank image */
       $bgc = imagecolorallocate ($im, 255, 255, 255);
       $tc  = imagecolorallocate ($im, 0, 0, 0);
       imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
       /* Output an errmsg */
       imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc);
   }
   return $im;
}
?>

Expected result:
----------------
The text "testing" 50 pixels from the left of the screen.

Actual result:
--------------
The text "testing" flush to the left.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34733&edit=1

Reply via email to