-
Notifications
You must be signed in to change notification settings - Fork 3.3k
LibPDF: Revert pattern support #22364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
Hello! One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the |
Contributor
Author
|
Red CI is unrelated. |
MacDue
added a commit
to MacDue/serenity
that referenced
this pull request
Oct 19, 2025
While working on SerenityOS#26292, I noticed that while fills/strokes can be Gfx::PaintStyles in LibPDF, currently they never are, which confused me. It turns out that a few years ago, tiled patterns were implemented in PR SerenityOS#22197, but were partially reverted due to crashes in SerenityOS#22364, leaving around a partial implementation. It appears the author was going to look into the crashes, but never got around to it. So, this patch resolves all the crashes on `0000.zip`, mainly by checking types and not assuming dictionary keys exist. Summary of `./Meta/test_pdf.py ~/Downloads/0000`: ``` Stacks: 0 crashes (0.0%) 0 distinct crash stacks 7 failed to open (0.7%) /home/macdue/Downloads/0000/0000346.pdf /home/macdue/Downloads/0000/0000202.pdf /home/macdue/Downloads/0000/0000399.pdf /home/macdue/Downloads/0000/0000421.pdf /home/macdue/Downloads/0000/0000480.pdf /home/macdue/Downloads/0000/0000920.pdf /home/macdue/Downloads/0000/0000819.pdf 3 files with password (0.3%) 909 files without issues (90.9%) ```
MacDue
added a commit
to MacDue/serenity
that referenced
this pull request
Oct 21, 2025
This reverts commit 6032c06. This relands the original commit with fixups to make `PatternColorSpace` more robust to unexpected inputs. While working on SerenityOS#26292, I noticed that while fills/strokes can be Gfx::PaintStyles in LibPDF, currently they never are, which confused me. It turns out that a few years ago, tiled patterns were implemented in PR SerenityOS#22197, but were partially reverted due to crashes in SerenityOS#22364, leaving around a partial implementation. It appears the author was going to look into the crashes, but never got around to it. So, this patch resolves all the crashes on `0000.zip`, mainly by checking types and not assuming dictionary keys exist. Summary of `./Meta/test_pdf.py ~/Downloads/0000`: ``` Stacks: 0 crashes (0.0%) 0 distinct crash stacks 7 failed to open (0.7%) /home/macdue/Downloads/0000/0000346.pdf /home/macdue/Downloads/0000/0000202.pdf /home/macdue/Downloads/0000/0000399.pdf /home/macdue/Downloads/0000/0000421.pdf /home/macdue/Downloads/0000/0000480.pdf /home/macdue/Downloads/0000/0000920.pdf /home/macdue/Downloads/0000/0000819.pdf 3 files with password (0.3%) 909 files without issues (90.9%) ``` Co-authored-by: MacDue <[email protected]>
nico
pushed a commit
that referenced
this pull request
Oct 21, 2025
This reverts commit 6032c06. This relands the original commit with fixups to make `PatternColorSpace` more robust to unexpected inputs. While working on #26292, I noticed that while fills/strokes can be Gfx::PaintStyles in LibPDF, currently they never are, which confused me. It turns out that a few years ago, tiled patterns were implemented in PR #22197, but were partially reverted due to crashes in #22364, leaving around a partial implementation. It appears the author was going to look into the crashes, but never got around to it. So, this patch resolves all the crashes on `0000.zip`, mainly by checking types and not assuming dictionary keys exist. Summary of `./Meta/test_pdf.py ~/Downloads/0000`: ``` Stacks: 0 crashes (0.0%) 0 distinct crash stacks 7 failed to open (0.7%) /home/macdue/Downloads/0000/0000346.pdf /home/macdue/Downloads/0000/0000202.pdf /home/macdue/Downloads/0000/0000399.pdf /home/macdue/Downloads/0000/0000421.pdf /home/macdue/Downloads/0000/0000480.pdf /home/macdue/Downloads/0000/0000920.pdf /home/macdue/Downloads/0000/0000819.pdf 3 files with password (0.3%) 909 files without issues (90.9%) ``` Co-authored-by: MacDue <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts the last two commits of #22197 for now due to causing #22362.