Repository navigation
Commit 7bb15c5
committed
Fix several small correctness bugs
- Archive.add(): fix broken assert (missing comma turned the error
message into part of the boolean expression, disabling the empty-name
check for binary content).
- Annot.file_info: avoid UnboundLocalError when a crafted/malformed
attachment's /FS dict has neither /UF nor /F.
- Page.set_language(): call pdfpage.obj() instead of passing the bound
method itself, which broke every call that actually sets a language.
- Widget.on_state(): skip None entries from button_states() instead of
raising TypeError.
- Pixmap.tobytes(): add missing f-string prefix so the alpha error
message actually includes the format name.
- JM_matrix_from_py(): fix copy-paste bug returning FzRect() instead of
FzMatrix() on the float-conversion failure path.
- utils.get_text(): remove a bare assert that made the documented
"misspelled option falls back to text" behavior unreachable.
- utils.get_label_pno(): return "" (as documented) instead of raising
IndexError when no label rule applies to the given page number.
- utils.get_sorted_text(): guard against ZeroDivisionError for
zero-width glyph bboxes.
- _apply_pages.py (method='fork'): send the actual page numbers to
workers instead of plain list indices, which silently processed the
wrong pages for any non-contiguous/non-zero-based `pages` list.
- table.chars_in_rect(): compare against c["top"]/c["bottom"] (top-down,
matching the rect from page.get_drawings()) instead of c["y0"]/c["y1"]
(PDF-native bottom-up space), fixing table detection for frames drawn
as filled rectangles.1 parent 733b19d commit 7bb15c5
4 files changed
Lines changed: 26 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
| 967 | + | |
967 | 968 | | |
968 | 969 | | |
969 | 970 | | |
| |||
2066 | 2067 | | |
2067 | 2068 | | |
2068 | 2069 | | |
2069 | | - | |
| 2070 | + | |
2070 | 2071 | | |
2071 | 2072 | | |
2072 | 2073 | | |
| |||
9510 | 9511 | | |
9511 | 9512 | | |
9512 | 9513 | | |
| 9514 | + | |
| 9515 | + | |
9513 | 9516 | | |
9514 | 9517 | | |
9515 | 9518 | | |
| |||
13680 | 13683 | | |
13681 | 13684 | | |
13682 | 13685 | | |
13683 | | - | |
| 13686 | + | |
13684 | 13687 | | |
13685 | 13688 | | |
13686 | 13689 | | |
| |||
14785 | 14788 | | |
14786 | 14789 | | |
14787 | 14790 | | |
14788 | | - | |
| 14791 | + | |
14789 | 14792 | | |
14790 | 14793 | | |
14791 | 14794 | | |
| |||
21609 | 21612 | | |
21610 | 21613 | | |
21611 | 21614 | | |
21612 | | - | |
| 21615 | + | |
21613 | 21616 | | |
21614 | 21617 | | |
21615 | 21618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
210 | | - | |
| 210 | + | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | | - | |
| 219 | + | |
219 | 220 | | |
220 | | - | |
221 | | - | |
| 221 | + | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | | - | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
243 | | - | |
244 | | - | |
| 246 | + | |
| 247 | + | |
245 | 248 | | |
246 | 249 | | |
247 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
| |||
0 commit comments