Edit report at https://bugs.php.net/bug.php?id=64499&edit=1
ID: 64499 Updated by: paj...@php.net Reported by: dhaliwaljee at gmail dot com Summary: test on php version = 5.3.13 and 5.3.5 -Status: Closed +Status: Not a bug Type: Bug Package: GD related Operating System: all PHP Version: 5.3.23 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2013-03-24 16:24:47] dhaliwaljee at gmail dot com Thanks to pajoye, it solved my problem. This site is very helpful rather than any other. ------------------------------------------------------------------------ [2013-03-24 14:53:54] paj...@php.net Or be sure that no space or other empty characters (or non empty :) are sent before the image, like a new line/space before the opening <?php. imagepng worst just fine, no matter if you use the bundled (recommended) or system library. ------------------------------------------------------------------------ [2013-03-24 14:04:10] larue...@php.net I can not reproduce this, did you build PHP with bundled gd? ------------------------------------------------------------------------ [2013-03-24 07:10:50] dhaliwaljee at gmail dot com Description: ------------ I have problem with imagepng; "imagepng()" This code shows broken image on browser, but its working fine to save the image on local disk. for example: imagepng($image,"a.png"); is working but I don't want to save this file. Test script: --------------- $image = imagecreatetruecolor(200, 400) or die("a"); $bg = imagecolorallocate($image, 255, 255, 255) or die("d"); imagestring($image, 12, 10, 100, "Hello", $bg) or die("b"); header('Content-type: image/png'); imagepng($image) or die("c"); Expected result: ---------------- "Hello" Image on Browser Actual result: -------------- Broken Image on Chrome and Firefox output: The image "http://localhost/Test/index.php" cannot be displayed because it contains errors. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64499&edit=1