php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43637 Bug report
Submitted: 2007-12-19 12:20 UTC Modified: 2007-12-22 17:14 UTC
From: sworddragon2 at aol dot com Assigned:
Status: Not a bug Package: Zlib related
PHP Version: 5.2.5 OS: Windows XP Professional SP2
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:
32 + 38 = ?
Subscribe to this entry?

 
 [2007-12-19 12:20 UTC] sworddragon2 at aol dot com
Description:
------------
If im trying to use the function gzfile() to a compressed file, that includes just a picture, the function don't read the complete file. On this reproduce, the function stops after the End Transmission Block.

Reproduce code:
---------------
$file=fopen("smiley1.gif","r");
$picture=fread($file,filesize("smiley1.gif"));
fclose($file);
$file=gzopen("smiley1.gz","w");
gzwrite($file,$picture);
gzclose($file);
//readgzfile("smiley1.gz"); With readgzfile, i get the correct picture information (132 Byte).
$file=gzfile("smiley1.gz");
print_r($file);

Expected result:
----------------
I expect to see all arrays until the end of the file.

Actual result:
--------------
With gzfile, i got just the array [0] with the content GIF89a

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-22 17:14 UTC] jani@php.net
Open the file in binary mode: 

$file=fopen("smiley1.gif","rb");

There's no bug here -> bogus.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC