#23056 [Ana->Bgs]: gif and jpeg php generated pictures bug
| From: | sniper@php.net | Date: | Sat, 05 Apr 2003 17:12:22 +0000 |
| Subject: | #23056 [Ana->Bgs]: gif and jpeg php generated pictures bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37174@lists.php.net to get a copy of this message | ||
ID: 23056
Updated by: sniper@php.net
Reported By: dan1 at edenpics dot com
-Status: Analyzed
+Status: Bogus
Bug Type: Output Control
Operating System: Linux RedHat 7.1
PHP Version: 4.3.2RC1
New Comment:
the example bird.gif is actually JPEG, not GIF..
And when having the correct script with correct imagetype,
this all works just fine.
This is NOT any bug in PHP.
Previous Comments:
------------------------------------------------------------------------
[2003-04-05 00:28:33] rasmus@php.net
I copied your script directly and found a bird.gif image out there.
You can see the result at:
http://lerdorf.com/bird.php
Source code at:
http://lerdorf.com/bird.phps
Works ok for me. Perhaps you have something before or after the
start/end php tags, or do you have weird line endings or something? Do
an "od -c bird.php" and compare it to:
http://lerdorf.com/bird.txt
------------------------------------------------------------------------
[2003-04-04 12:55:43] dan1 at edenpics dot com
Something more: this happens with all versions of Internet Explorer
------------------------------------------------------------------------
[2003-04-04 12:21:28] dan1 at edenpics dot com
Sorry, $output is the file name.
here is the correct code:
<?
header("Content-type: image/gif");
$output="bird.gif"; // file name
$fd = fopen($output,"r");
$filelength=filesize($output);
$contents = fread($fd,$filelength);
echo $contents; fclose($fd);
?>
I tried PHP version 4.3.2RC1. The same happens.
This bug appears with jpeg (.jpg) files too, with the "e99\r\n" code
before the picture datas, and they can only be saved as BMP too.
------------------------------------------------------------------------
[2003-04-04 11:05:48] sniper@php.net
fixed script, using PHP 4.3.2-RC, and it works fine.
------------------------------------------------------------------------
[2003-04-04 11:04:22] sniper@php.net
Your script is broken. (what is $output supposed to contain??)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23056
--
Edit this bug report at http://bugs.php.net/?id=23056&edit=1