|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54686 Displays error when I want to display a PNG with imagepng($file)
Submitted: 2011-05-07 15:12 UTC Modified: 2011-05-07 15:22 UTC
From: juanjp at live dot com Assigned:
Status: Not a bug Package: *Graphics related
PHP Version: 5.2.17 OS: Windows XP Home Edition SP3
Private report: No CVE-ID: None
 [2011-05-07 15:12 UTC] juanjp at live dot com
From manual page:
The bug occurs with imagepng(). It just displays an error. The code was completely copied from:

Test script:
header("Content-Type: image/png");
$im = @imagecreate(110, 20)
    or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);

Expected result:
An image is supposed to appear (the file path is correct).

Actual result:
Displays: The image “http://localhost:8080/myphpfile.php” cannot be displayed because it contains errors.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-07 15:22 UTC]
-Status: Open +Status: Bogus
 [2011-05-07 15:22 UTC]
Show the source, you certainly left a white space after ?>, delete the ending tag 
and it should work.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 12:01:27 2019 UTC