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
 [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-2019 The PHP Group
All rights reserved.
Last updated: Sun May 26 01:01:26 2019 UTC