From:             witekfl at poczta dot onet dot pl
Operating system: Linux
PHP version:      5.2.5
PHP Bug Type:     Filter related
Bug description:  Deflate filter doesn't compress all data

Description:
------------
The deflate filter doesn't compress all data.
The decompressed data is 1721662 bytes long.

Reproduce code:
---------------
<?php
$f = fopen("http://republika.pl/rkd/data.bz2";, "rb");
$data = '';
while (!feof($f)) {
        $data .= fread($f, 32768);
}
fclose($f);
$text = bzdecompress($data);

$f3 = fopen("data.html.deflate", "wb");
stream_filter_append($f3, 'zlib.deflate', STREAM_FILTER_WRITE);
fwrite($f3, $text); fclose($f3);

$f5 = fopen("data.html.deflate", "rb");
stream_filter_append($f5, 'zlib.inflate', STREAM_FILTER_READ);
$text_deflate = ''; while (!feof($f5)) { $text_deflate .= fread($f5,
32768); } fclose($f5);

printf("original = %d, deflate = %d\n", strlen($text),
strlen($text_deflate));
?>


Expected result:
----------------
original = 1721662, deflate = 1721662


Actual result:
--------------
original = 1721662, deflate = 546816


-- 
Edit bug report at http://bugs.php.net/?id=43400&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43400&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43400&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43400&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43400&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43400&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43400&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43400&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43400&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43400&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43400&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43400&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43400&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43400&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43400&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43400&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43400&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43400&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43400&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43400&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43400&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43400&r=mysqlcfg

Reply via email to