php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: juanjp at live dot com
New email:
PHP Version: OS:

 

 [2011-05-07 15:12 UTC] juanjp at live dot com
Description:
------------
---
From manual page: http://www.php.net/function.imagepng
---
The bug occurs with imagepng(). It just displays an error. The code was completely copied from: http://php.net/manual/en/function.imagecreate.php

Test script:
---------------
<?php
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);
imagepng($im);
imagedestroy($im);
?>

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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-07 15:22 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-05-07 15:22 UTC] pajoye@php.net
Show the source, you certainly left a white space after ?>, delete the ending tag 
and it should work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC