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

fix(security): redact elements outside of page #133

Merged
mahlzahn merged 2 commits from mahlzahn/fix_redact_outside_page into main 2026年03月11日 15:58:09 +01:00 AGit

Closes: #121

- utilizes PyMuPDF’s redaction annotations with infinite rectangles around the page - Alternatively, there is [`pymupdf.Page.clip_to_rect`](https://pymupdf.readthedocs.io/en/latest/page.html#Page.clip_to_rect), but the following command did not remove elements outside of page border reliably: ```py mupdf_page.clip_to_rect(mupdf_page.cropbox) ``` - makes tests of files in https://github.com/py-pdf/sample-files/tree/main/009-pdflatex-geotopo succeed - adds a simple test file with elements outside of the page’s cropbox Closes: #121
fix(security): redact elements outside of page
All checks were successful
/ build-start (pull_request_target) Successful in 9s
/ merge-conditions (pull_request) Successful in 7s
/ checks (pull_request) Successful in 1m1s
b162d82c08
- utilizes PyMuPDF’s redaction annotations with infinite rectangles around the page
- makes tests of files in https://github.com/py-pdf/sample-files/tree/main/009-pdflatex-geotopo succeed
Closes: #121 
mahlzahn added this to the v0.5.0 milestone 2026年03月11日 12:28:25 +01:00
censor-bot approved these changes 2026年03月11日 12:31:34 +01:00
Dismissed

Note

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

curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6270927/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/6270927) for b162d82c0812a0a07b203dd09f32f90955c96f85 finished with status **success**. Install and run the x86_64 test build with: > > curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6270927/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak > flatpak install --user censor-dev.flatpak > flatpak run --user page.codeberg.censor.Censor.Devel
@ -132,0 +136,4 @@
pymupdf.Rect(-inf, -inf, page.x0, inf),
pymupdf.Rect(page.x1, -inf, inf, inf),
pymupdf.Rect(-inf, -inf, inf, page.y0),
pymupdf.Rect(-inf, page.y1, inf, inf),
Author
Owner
Copy link

Add minimal test file with text/rectangles outside of page.

Add minimal test file with text/rectangles outside of page.
mahlzahn marked this conversation as resolved
mahlzahn dismissed censor-bot's review 2026年03月11日 15:50:21 +01:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

chore: add test file for outside of page elements
All checks were successful
/ build-start (pull_request_target) Successful in 10s
/ checks (pull_request) Successful in 1m7s
/ release-prepare (pull_request_target) Has been skipped
/ merge-conditions (pull_request) Successful in 8s
/ release-publish (pull_request_target) Has been skipped
affc0e40e6

Note

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

curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6271917/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/6271917) for affc0e40e62614421c5b1218a17185621dc6b00a finished with status **success**. Install and run the x86_64 test build with: > > curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6271917/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak > flatpak install --user censor-dev.flatpak > flatpak run --user page.codeberg.censor.Censor.Devel
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!133
Reference in a new issue
censor/Censor
No description provided.
Delete branch "mahlzahn/fix_redact_outside_page"

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?