Bug #39616 [Com]: gzuncompress() data error
Edit report at https://bugs.php.net/bug.php?id=39616&edit=1
ID: 39616
Comment by: emanuele at fondani dot it
Reported by: emanuele at fondani dot it
Summary: gzuncompress() data error
Status: Not a bug
Type: Bug
Package: Zlib related
Operating System: Windows/Linux
PHP Version: 4.*, 5.*
Block user comment: N
Private report: N
New Comment:
As Google Code is closing, I've moved the code to github:
https://github.com/eiannone/zlibdecompress
Previous Comments:
------------------------------------------------------------------------
[2010-11-29 01:17:37] emanuele at fondani dot it
After many email requests for the code, i published it as a google code project.
You can download it at: http://code.google.com/p/zlibdecompress/
------------------------------------------------------------------------
[2009-11-20 09:03:36] emanuele at fondani dot it
I found that the issue is due to the fact that in some cases in the gzipped pdf stream the zlib
stream header (see RFC 1950) is missing or invalid, and the gzuncompress() function cannot
decompress data.
Here's my workaround to fix the problem: I wrote a new ZlibDecompress class in PHP from some
original C++ code by Mark Adler taken from the official zlib site, which uses the standard algorithm
and always decompress the string correctly, ignoring the zlib stream header, as it contains only CRC
data.
Obviously this PHP class is much more slower than gzuncompress function, because it is not compiled,
so I use it only when gzuncompress fails. For pdf files this happens only in a few cases, so this is
a good compromise for me.
If anyone is interested please contact me by email and I will send the class file.
------------------------------------------------------------------------
[2006-11-27 12:07:53] mgf@php.net
There's a suggested link in tony2001's message. Mailing lists and newsgroups are usually
good support channels.
------------------------------------------------------------------------
[2006-11-24 12:36:09] emanuele at fondani dot it
Please be more specific. Where can I get more information about this problem?
What are the "support channels" you mean? Can you suggest a link?
Thank you
------------------------------------------------------------------------
[2006-11-24 12:24:15] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
------------------------------------------------------------------------
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=39616
--
Edit this bug report at https://bugs.php.net/bug.php?id=39616&edit=1
Thread (8 messages)