php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12138 Image broken
Submitted: 2001-07-13 07:07 UTC Modified: 2001-07-26 18:42 UTC
From: adrieder at sbox dot tugraz dot at Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.0.6 OS: Sparc Solaris 8
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: adrieder at sbox dot tugraz dot at
New email:
PHP Version: OS:

 

 [2001-07-13 07:07 UTC] adrieder at sbox dot tugraz dot at
test.php

<?php
header ("Content-type: image/png");
$im = @ImageCreate (50, 100)
    or die ("Cannot Initialize new GD image stream");
    $background_color = ImageColorAllocate ($im, 255, 255, 255);
    $text_color = ImageColorAllocate ($im, 233, 14, 91);
    ImageString ($im, 1, 5, 5,  "test", $text_color);
    ImagePng ($im);
    ImageDestroy($im);
?>


test.html

<html>
<head><title>test</title></head>
<body>
    Hello<br><br>
    <img src=test.php>
</body>
</html>

Configuration:

gd-1.8.4, apache-1.3.20, php-4.0.6

      ./configure\
        --without-mysql\
        --with-oci8 \
        --with-oracle\
        --with-imap\
        --with-ldap\
        --with-db3 \
        --enable-sysvsem\
        --enable-sysvshm\
        --with-mm=/usr/local\
        --enable-track-vars\
        --enable-trans-sid\
        --enable-shmop\
        --with-gd \
        --with-png-dir=/usr/local/lib \
        --with-zlib-dir=/usr/local/lib \
        --enable-inline-optimization \
        --enable-bcmath \
        --with-gettext \
        --with-mcal=/usr/local/mcal \
        --with-mcrypt \
        --disable-debug \
        --with-apxs=/usr/local/apache/bin/apxs    

Desc:
When the Image (test.php) is referenced by a html file (test.html) it is shown as broken in the browser window.

When calling test.php directly the Image is shown correctly, but by shift-reloading the page (test.php) the image is broken again (a normal reload shows the image).

It did not occur with php-4.0.5

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-21 20:42 UTC] andy@php.net
Are you saying that the image works fine when it is
requested by itself (test.php), but not when it is
referenced by a html page (test.html)?
 [2001-07-23 09:20 UTC] andy@php.net
I was not able to reproduce this error, and think that it is bogus
(or is a problem with his browser.)    Can anyone else verify
this?
 [2001-07-26 18:42 UTC] sniper@php.net
The example script and html both work just fine for
me too. Try asking this on php-general@lists.php.net
as there are dozens of people who can help you with this.

Not a bug in PHP.

 [2002-05-20 18:51 UTC] JohannesBauer at gmx dot de
I have the very same bug, only using PHP 4.2.1 on a Linux machine!

I have absolutely no clue why this problem occours. My script:

show.php:
<?php
header("Content-type: image/jpeg");
$bild="/home/httpd/bilder/unkatalogisiert/".$bildname;
if ($fp=fopen($bild,"r")) {
  fpassthru($fp);
}
fclose($fp);
?>

When I refer to this image using e.g.:

<img src="show.php?bildname=blabla.jpg">

It appearently is loaded by the browser (takes a while) but then displayed as broken. Had this in Netscape 4.79 and IE 5.50. When I refer directly to the picture, i.e. I enter as an URL:

http://192.168.1.1/show.php?bildname=blabla.jpg

The picture loads perfectly. Strangely, when using the <img src> construct with Opera 6, it works! Something is quite messed up somewhere, I can find no solution whatsoever.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 19:01:32 2025 UTC