|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-21 15:36 UTC] iliaa@php.net
[2004-12-21 17:06 UTC] douglasrice at yahoo dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 01:00:02 2025 UTC |
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 IHDRd2????PLTE????[?˝?eIDATx?c` `fx???`? ???????? [vK????? ? ??\6p?)??u.``iP o9?٦?©Ty܍??㥀????X&Z?u Y?????IEND?B`?