[PHP-DEV] Bug #1032: file() not retrieving GIF properly From: birnbaum <email protected>
Date: 01/05/99

From: birnbaum <email protected>
Operating system: linux (redhat 5.2)
PHP version: 3.0.6
PHP Bug Type: Misbehaving function
Bug description: file() not retrieving GIF properly

I believe the following two code fragments should both put out the image in question but only the first one (readfile) works:
------------
Header("Content-type: image/gif");
readfile("/home/httpd/html/olaf/graphics/k2.gif");
exit;
-----------

-----------
Header("Content-type: image/gif");
$image = implode(file("/home/httpd/html/olaf/graphics/k2.gif"), "");
print $image;
exit;
----------

I don't want to put the file straight out to STDOUT, I want to hold it and examine it in memory.

The second fragment produces a broken GIF and, using some prints, I have determined that it doesn't get the entire file, though I can't figure out exactly which bytes it gets and doesn't get.

It also fails when using a URL instead of a server file.

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>