ID: 24690 Updated by: [EMAIL PROTECTED] Reported By: peteralien2003 at yahoo dot com -Status: Open +Status: Feedback -Bug Type: Unknown/Other Function +Bug Type: GD related Operating System: Win XP Pro PHP Version: 4.3.2 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Can not reproduce. There might be errors during the script execution but you won't see them if you output the image on browser. Try this script: <?php error_reporting(E_ALL); $img = ImageCreate(115,55); $ip = '192.168.0.1'; $alt = "(c) 2003 Peter Alien"; $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); $shadow = ImageColorAllocate($img, 84,84,84); $textColor = ImageColorAllocate($img, 0,0,0); $white = ImageColorAllocate($img, 255,255,255); ImageRectangle($img,0,0,115-1,55-1,$shadow); ImageRectangle($img,0,0,115,55,$white); ImageTTFText($img,10,0,5,20,$shadow,"times.ttf","$ip\n\r$alt"); ImageTTFText($img,10,0,4,19,$textColor,"times.ttf","$ip\n\r$alt"); ImagePng($img, "foo.png"); ImageDestroy($img); ?> Previous Comments: ------------------------------------------------------------------------ [2003-07-17 06:15:46] peteralien2003 at yahoo dot com Description: ------------ I have: Win XP Pro IIS 5.1 PHP 4.3.2 GD 2.0.12 Reproduce code: --------------- <? Header("Content-type: image/png"); $img = ImageCreate(115,55); $ip = $_SERVER['REMOTE_ADDR']; $alt = "(c) 2003 Peter Alien"; //ImageColorTransparent($img,$bgcolor); $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // blue $shadow = ImageColorAllocate($img, 84,84,84); // gray $textColor = ImageColorAllocate($img, 0,0,0); // black $white = ImageColorAllocate($img, 255,255,255); //left upper corner ImageRectangle($img,0,0,115-1,55-1,$shadow); //shadow effect ImageRectangle($img,0,0,115,55,$white); ImageTTFText($img,10,0,5,20,$shadow,"times.ttf","$ip\n\r$alt"); // text shadow effect ImageTTFText($img,10,0,4,19,$textColor,"times.ttf","$ip\n\r$alt"); // text color //ImageJpeg($img); ImagePng($img); ImageDestroy($img); ?> Expected result: ---------------- It was supposed to appear an image with the IP of the machine in the browser. Actual result: -------------- Sometimes appears an image but other times it just appears the placehold of it, even when i refresh the browser. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24690&edit=1
