-
-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gzuncompress function returns Data Error #160
Comments
Can you share the PDF in question? We normally already have a fallback implemented: FPDI/src/PdfParser/Filter/Flate.php Lines 45 to 50 in 88a3aff
|
With this PDF for example it was not working for me. |
The file works without a problem and already the fallback I quoted before is used. I isolated the logic to this and all PHP versions work there, too. What PHP version are you using? And what is the zlib version that is used? (see phpinfo() output). |
Added test case that fails with gzuncompress() but works with the fallback logic (extracted from file in #160).
PHP 8.0.26 I think, I have found a possible problem for me. I have a custom Error Handler implemented, which prints the warning "Warning: gzuncompress(): data error" anyway. Think this solves the problem for me. |
Ok, so you simply need to adjust your error handler to take care of the current error level:
|
FPDI/src/PdfParser/Filter/Flate.php
Line 42 in 88a3aff
The gzuncompress function returns sometimes a Data Error as explaned in the User Contributed Notes from
https://www.php.net/manual/en/function.gzuncompress.php
The workaround from the user with the gzuncompress_crc32 function works for me in these cases.
The text was updated successfully, but these errors were encountered: