Skip to content

Use ctx.filter unconditionally in the src/display/canvas.js file #19756

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

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Apr 3, 2025

It seems that the @napi-rs/canvas dependency has basic canvas-filter support, whereas the "old" canvas dependency didn't, hence we no longer need the Node.js-specific checks in the src/display/canvas.js file.

Note that I've successfully tested the pdf2png example with this patch applied and things appear to work as before.

Smaller diff with https://github.com/mozilla/pdf.js/pull/19756/files?w=1

It seems that the `@napi-rs/canvas` dependency has *basic* canvas-filter support, whereas the "old" `canvas` dependency didn't, hence we no longer need the Node.js-specific checks in the `src/display/canvas.js` file.

Note that I've successfully tested the [`pdf2png` example](https://github.com/mozilla/pdf.js/tree/master/examples/node/pdf2png) with this patch applied and things appear to work as before.
@Snuffleupagus Snuffleupagus force-pushed the canvas-unconditional-ctx-filter branch from 4ddd123 to 0c78b46 Compare April 3, 2025 10:30
@Snuffleupagus
Copy link
Collaborator Author

/botio browsertest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/751d33ffd788cc2/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_browsertest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e9ab19764c6aa03/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/751d33ffd788cc2/output.txt

Total script time: 16.35 mins

  • Regression tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/e9ab19764c6aa03/output.txt

Total script time: 30.83 mins

  • Regression tests: Passed

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit a70f423 into mozilla:master Apr 5, 2025
9 checks passed
@Snuffleupagus Snuffleupagus deleted the canvas-unconditional-ctx-filter branch April 5, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants