Bug #39616 [Nab]: gzuncompress() data error

From: Date: Fri, 13 Mar 2015 09:49:38 +0000
Subject: Bug #39616 [Nab]: gzuncompress() data error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191370@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=39616&edit=1

 ID:                 39616
 Updated by:         mike@php.net
 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:

Did you try zlib_decode() yet? (since PHP-5.4)


Previous Comments:
------------------------------------------------------------------------
[2015-03-13 07:34:23] emanuele at fondani dot it

As Google Code is closing, I've moved the code to github:
https://github.com/eiannone/zlibdecompress

------------------------------------------------------------------------
[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

------------------------------------------------------------------------


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)

« previous php.bugs (#191370) next »