ID: 31229 User updated by: douglasrice at yahoo dot com Reported By: douglasrice at yahoo dot com Status: Bogus Bug Type: Apache related Operating System: Windows XP Pro PHP Version: 4.3.10 New Comment:
Thanks for your quick response. The problem is that I don't know what to do from here... I thought that the PHP would be working fine and that it is an Apache problem. However, do you know what can cause this? Any faq reference would be great. Many Thanks for you help. Previous Comments: ------------------------------------------------------------------------ [2004-12-21 15:36:21] [EMAIL PROTECTED] The output seems to be correct for a PNG image, it seems that the header identifying the content is being removed by apache or ignored by your browser. ------------------------------------------------------------------------ [2004-12-21 13:40:16] douglasrice at yahoo dot com Description: ------------ Apologies if this isn't a bug. Suspect it is an Apache problem. I have Apache 1.3.33 and PHP 4.3.10 running on Windows XP Pro with Service Pack 2 installed. I have retrieved a jpeg file into a php variable. When trying to display the image i.e. echo("$pic"), the data of the jpeg rather than the jpeg itself is printed out. Have used the sample code for "Creating a new GD image stream and outputting an image." in php manual and this does the same thing...display the image "data" rather than the image. I have included header info ie content type = image/png or image/jpeg to with no luck. I suspect it is a setting in Apache, but have trawled the internet and found many people with the same problem, but no-one has an answer.....can you help? Reproduce code: --------------- <?php header("Content-type: image/png"); $im = @imagecreate(100, 50) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng($im); imagedestroy($im); ?> Expected result: ---------------- An image is drawn to screen Actual result: -------------- The following is displayed to screen... PNG IHDRd2PLTE[˝eIDATxc` `fx` [vK \6p)u.``iP o9٦©Ty܍㥀X&Zu YIENDB` ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31229&edit=1