Skip to content

Conversation

@nico
Copy link
Contributor

@nico nico commented Dec 20, 2023

Reverts the last two commits of #22197 for now due to causing #22362.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Dec 20, 2023
@BuggieBot
Copy link
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@nico
Copy link
Contributor Author

nico commented Dec 20, 2023

Red CI is unrelated.

@awesomekling awesomekling merged commit 6032c06 into SerenityOS:master Dec 21, 2023
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Dec 21, 2023
@nico nico deleted the unpattern branch December 21, 2023 18:33
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants