Introducing a pypdf CLI program - close #2160#2170
Conversation
| base: Any | ||
| hival: Any | ||
| if isinstance(color_space, ArrayObject) and color_space[0] == "/Indexed": | ||
| if isinstance(color_space, ArrayObject) and len(color_space) == 4 and color_space[0] == "/Indexed": |
There was a problem hiding this comment.
How is this change related to the CLI?
There was a problem hiding this comment.
This is a fixup for a bug.
Introducing this CLI and the related unit tests revealed this issue:
File "/opt/pypdf/pypdf/filters.py", line 851, in _handle_flate
color_space, base, hival, lookup = (
ValueError: not enough values to unpack (expected 4, got 3)
There is also another bug spotted there:
https://github.com/py-pdf/pypdf/blob/issue-2160/tests/test_cli.py#L91
There was a problem hiding this comment.
@Lucas-C
can you provide the pdf showing the issue
There was a problem hiding this comment.
Yes, this is one of py-pdf test samples: https://github.com/py-pdf/pypdf/blob/main/resources/AutoCad_Diagram.pdf
The error was raised by simply calling pypdf extract-images AutoCad_Diagram.pdf
There was a problem hiding this comment.
I reported the 2nd bug there: #2176
Should I open a distinct issue for the 1st bug, regarding filters.py & color_space?
|
This PR can probably be closed, given that https://github.com/py-pdf/pdfly offers similar functionalities |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2170 +/- ##
==========================================
+ Coverage 94.25% 94.29% +0.04%
==========================================
Files 42 43 +1
Lines 7556 7630 +74
Branches 1487 1499 +12
==========================================
+ Hits 7122 7195 +73
Misses 266 266
- Partials 168 169 +1
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here. |
|
I will not merge the change done with However, the change to |
|
@Lucas-C How should we continue with this PR? |
|
@Lucas-C Friendly reminder :-) How do you want to continue with this PR? |
|
I'm closing this PR as I assume that this will not have a follow-up. If I'm wrong, we can still re-open :-) |
What's missing: