Req #44893 [Opn->Csd]: gzfile() does not load complete GIF file

From: Date: Tue, 22 Sep 2020 14:54:37 +0000
Subject: Req #44893 [Opn->Csd]: gzfile() does not load complete GIF file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229139@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=44893&edit=1 ID: 44893 Updated by: cmb@php.net Reported by: sworddragon2 at aol dot com Summary: gzfile() does not load complete GIF file -Status: Open +Status: Closed Type: Feature/Change Request Package: Zlib related Operating System: Windows XP Professional SP3 PHP Version: 5CVS, 6CVS (2008-10-30) -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: gzfile() is for reading compressed *text* files. However, GIF files are no text files. This feature request doesn't make any sense to me. Previous Comments: ------------------------------------------------------------------------ [2008-11-21 17:57:50] jani@php.net gzfile() is not binary-safe. So the behaviour here isn't really unexpected. Anyway, you're better of using gzread() instead when dealing with binary files. ------------------------------------------------------------------------ [2008-11-02 23:13:05] sworddragon2 at aol dot com I tried it with wb, but it doesn't help. The problem is, that gzfile stops the read process after 7/132 byte. The read process is breaking after gzfile reads the ETB (End Transmission Block), which is the seventh char of this picture. ------------------------------------------------------------------------ [2008-10-30 17:15:40] jani@php.net $file=gzopen("smiley1.gz","w"); I think that should also be "wb" under windows.. ------------------------------------------------------------------------ [2008-10-30 17:14:14] jani@php.net What actually is the bug here? You're concatenating same image in same file and expect..what? ------------------------------------------------------------------------ [2008-10-29 17:29:49] sworddragon2 at aol dot com I tested it with the 5.2.7RC2-dev and the 5.3.0alpha3-dev from your link, but the bug isn't fixed. In both versions, Firefox 3.0.3 gives me an output of: Array ( [0] => GIF89a ) It breaks again after the End Transmission Block. I used the same picture again. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=44893 -- Edit this bug report at https://bugs.php.net/bug.php?id=44893&edit=1

« previous php.bugs (#229139) next »