ID:               23056
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dan1 at edenpics dot com
-Status:           Open
+Status:           Analyzed
 Bug Type:         Output Control
 Operating System: Linux RedHat 7.1
 PHP Version:      4.3.2RC1
 New Comment:

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



Previous Comments:
------------------------------------------------------------------------

[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] [EMAIL PROTECTED]

fixed script, using PHP 4.3.2-RC, and it works fine.


------------------------------------------------------------------------

[2003-04-04 11:04:22] [EMAIL PROTECTED]

Your script is broken. (what is $output supposed to contain??)



------------------------------------------------------------------------

[2003-04-04 10:56:07] dan1 at edenpics dot com

Hello.

I found out something strange: when I generate a picture with PHP, the
output (sniffed on the net) starts with something like "c02\r\n" before
the rest of the picture ("GIF89a.."): this does not frighten Netscape,
however IE does display it, but when you want to save it, then it
doesn't understand the format and you cannot save the picture in the
real format, but only in BMP.

I made a little report of what I did to find this out, and saw that
huge amount of people had this problem..

Here is the link of the report:
http://www.edenpics.com/pub/iebug/iebug2.phtml

And here is the code that generates the bug:
<?
header("Content-type: image/gif");
$fd = fopen("bird.gif","r");
$filelength=filesize($output);
$contents = fread($fd,$filelength);
echo $contents; fclose($fd);
?>

Thank you for looking at this.. it took me time to find it, so I hope
this will help !

Kind Regards to you programmer,
Daniel


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=23056&edit=1

Reply via email to