censor/Censor
1
37
Fork
You've already forked Censor
3

fix: redact annotations, widgets and links also if point-like #179

Merged
mahlzahn merged 1 commit from mahlzahn/fix_point_redaction into main 2026年03月24日 19:37:38 +01:00 AGit

PyMuPDF’s rectangle intersection fails if one of the rectangles is a point. Replace by Censor’s own rectangle intersection function.

Closes: #162

PyMuPDF’s rectangle intersection fails if one of the rectangles is a point. Replace by Censor’s own rectangle intersection function. Closes: #162
fix: redact annotations, widgets and links also if point-like
All checks were successful
/ build-start (pull_request_target) Successful in 22s
/ merge-conditions (pull_request) Successful in 8s
/ checks (pull_request) Successful in 1m14s
/ release-publish (pull_request_target) Has been skipped
e39c19a8c0
PyMuPDF’s rectangle intersection fails if one of the rectangles is a point. Replace by Censor’s own rectangle intersection function.
Closes: #162 
mahlzahn added this to the v0.7.0 milestone 2026年03月24日 19:10:50 +01:00

Note

The build job for e39c19a8c0 finished with status success. Install and run the x86_64 test build with:

curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6337568/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak
flatpak install --user censor-dev.flatpak
flatpak run --user page.codeberg.censor.Censor.Devel
> **Note** > The [build job](https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6337568) for e39c19a8c0a1f582737784631230ddf733a9a2e4 finished with status **success**. Install and run the x86_64 test build with: > > curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6337568/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak > flatpak install --user censor-dev.flatpak > flatpak run --user page.codeberg.censor.Censor.Devel
Author
Owner
Copy link

The redaction validation was already using Censor's intersection method ;), e.g.,

Lines 562 to 565 in e39c19a
for widget in mupdf_page.widgets():
if any(r.intersects(Rectangle(widget.rect))
for r in redactions):
count_widgets_not_redacted += 1
The redaction validation was already using Censor's intersection method ;), e.g., https://codeberg.org/censor/Censor/src/commit/e39c19a8c0a1f582737784631230ddf733a9a2e4/src/pymupdf_helpers.py#L562-565
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
censor/Censor!179
Reference in a new issue
censor/Censor
No description provided.
Delete branch "mahlzahn/fix_point_redaction"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?