php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64499 test on php version = 5.3.13 and 5.3.5
Submitted: 2013-03-24 07:10 UTC Modified: 2013-03-24 16:37 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dhaliwaljee at gmail dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.3.23 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dhaliwaljee at gmail dot com
New email:
PHP Version: OS:

 

 [2013-03-24 07:10 UTC] 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.

Patches

imagepng_processing (last revision 2013-03-24 07:12 UTC by dhaliwaljee at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-24 14:04 UTC] laruence@php.net
I can not reproduce this, did you build PHP with bundled gd?
 [2013-03-24 14:53 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2013-03-24 14:53 UTC] pajoye@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 16:24 UTC] dhaliwaljee at gmail dot com
Thanks to pajoye,
it solved my problem.

This site is very helpful rather than any other.
 [2013-03-24 16:24 UTC] dhaliwaljee at gmail dot com
-Status: Feedback +Status: Closed
 [2013-03-24 16:37 UTC] pajoye@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 23:01:28 2025 UTC