php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9509 garbled image file
Submitted: 2001-03-01 11:19 UTC Modified: 2001-04-10 10:14 UTC
From: rupert at ditzed dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: Windows98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 24 = ?
Subscribe to this entry?

 
 [2001-03-01 11:19 UTC] rupert at ditzed dot org
I was previously using fopen() and fpassthru to grab a gif image and pass it to the browser. This worked fine.
Then I installed PHP4.0.4pl1 and the image that now gets returned is garbled (the image appears to be the right dimensions, but filesize shows 150 bytes, not 406 bytes which is what the image actually is).

On any html page the following line was installed:

<IMG src="track.php?ref=12345">

track.php then looks like this:

<?
  $image = fopen ("track.gif", "r");

  fpassthru ($image);
?>

I tried the same with the readfile() function, as follows:

<?
  readfile("track.gif");
?>

same result.


Other file I/O appears to be fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-01 22:10 UTC] sniper@php.net
Try adding 'b' into fopen:

$image=fopen("track.gif", "rb");

Check the manual page for fopen:

http://www.php.net/fopen

--Jani

 [2001-04-10 10:14 UTC] sniper@php.net
No feedback and most likely the missing 'b' issue.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC