-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ENH: Add support for BrotliDecode filter (PDF 2.0) #3223 #3254
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3254 +/- ##
=======================================
Coverage 96.60% 96.60%
=======================================
Files 53 53
Lines 8973 8992 +19
Branches 1659 1662 +3
=======================================
+ Hits 8668 8687 +19
Misses 183 183
Partials 122 122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1573164
to
d339bc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Is the official specification available in the meantime?
Apart from this, I have left some comments I stumbled upon during the review.
274ed94
to
4dd3fa0
Compare
Reverting the requirements.txt files to main will show an error that the package is not installed. Is there any other way to get them installed? - I have added them in dev.in and ci.in - expecting that the req will be generated while running the pipeline. |
The official specification for Brotli compression in PDF is not yet released. However, the PDF Association has announced its upcoming inclusion in PDF 2.0. Sample PDF files are available for developers to begin testing. https://pdfa.org/brotli-compression-coming-to-pdf/ |
You can change the |
8b4514f
to
b7a5245
Compare
672f080
to
a4fdd61
Compare
tests/test_filters.py
Outdated
def test_brotli_missing_installation_mocked(): | ||
"""Verify BrotliDecode raises ImportError if brotli is not installed.""" | ||
# Import pypdf.filters *after* patching sys.modules | ||
import pypdf.filters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this as local imports?
1f83b52
to
025226a
Compare
Implements the BrotliDecode filter as specified in ISO 32000-2:2020, Section 7.4.11. Adds necessary constants, integrates the filter into the decoding logic, includes brotli as an optional dependency, adds unit tests, and updates documentation.
Closes #3223