Skip to content

Commit

Permalink
no emptiness checks
Browse files Browse the repository at this point in the history
  • Loading branch information
JorjMcKie committed Jun 17, 2024
1 parent 66adf91 commit 0d93499
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7585,7 +7585,6 @@ def _add_redact_annot(self, quad, text=None, da_str=None, align=0, fill=None, te
annot = mupdf.pdf_create_annot(page, mupdf.PDF_ANNOT_REDACT)
q = JM_quad_from_py(quad)
r = mupdf.fz_rect_from_quad(q)
assert not mupdf.fz_is_empty_rect(r), "quad / rectangle is empty"
# TODO calculate de-rotated rect
mupdf.pdf_set_annot_rect(annot, r)
if fill:
Expand Down
16 changes: 0 additions & 16 deletions tests/test_annots.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,22 +217,6 @@ def test_redact4():
assert line_art == page.get_drawings()


def test_redact5():
"""Prevent empty redaction rectangles."""
if not hasattr(pymupdf, "mupdf"):
print("Not executing 'test_redact5' in classic")
return
filename = os.path.join(scriptdir, "resources", "symbol-list.pdf")
doc = pymupdf.open(filename)
page = doc[0]
raised = False
try:
redact = page.add_redact_annot(pymupdf.EMPTY_RECT())
except Exception:
raised = True
assert raised


def test_1645():
'''
Test fix for #1645.
Expand Down

0 comments on commit 0d93499

Please sign in to comment.