Skip to content

Commit

Permalink
src/ tests/: Fix bug in Page.get_bboxlog().
Browse files Browse the repository at this point in the history
src/__init__.py:
    Fix JM_new_bbox_device_Device; member fns begin_layer() and end_layer()
    were incorrectly defined.
tests/:
    Add test_bboxlog_2885(), exposed problem in JM_new_bbox_device_Device's
    begin_layer() and end_layer() callbacks.
  • Loading branch information
julian-smith-artifex-com committed Jan 22, 2024
1 parent 30befe7 commit da1b52e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19133,8 +19133,8 @@ def __init__(self, result, layers):
self.use_virtual_begin_layer()
self.use_virtual_end_layer()

self.begin_layer = jm_lineart_begin_layer
self.end_layer = jm_lineart_end_layer
begin_layer = jm_lineart_begin_layer
end_layer = jm_lineart_end_layer

fill_path = jm_bbox_fill_path
stroke_path = jm_bbox_stroke_path
Expand Down
Binary file added tests/resources/test_2885.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,3 +801,9 @@ def test_3070():
links[0]['uri'] = "https://www.ddg.gg"
pdf[0].update_link(links[0])
pdf.save(os.path.abspath(f'{__file__}/../../tests/test_3070_out.pdf'))

def test_bboxlog_2885():
doc = fitz.open(os.path.abspath(f'{__file__}/../../tests/resources/test_2885.pdf'))
page=doc[0]
bbl = page.get_bboxlog()
bbl = page.get_bboxlog(layers=True)

0 comments on commit da1b52e

Please sign in to comment.