Skip to content

Wide PDFs, Antialiasing, Minor Improvements #249

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

patinthehat
Copy link
Collaborator

@patinthehat patinthehat commented May 16, 2025

This PR introduces several enhancements and fixes across the codebase, focusing on improving PDF handling, updating workflows, and adding new test utilities. Key changes include updates to support ultra-wide PDFs, enhancements to the CI workflow, and new helper functions for testing.

It resolves #245, which adds antialias support when saving images, and #248, which is a bug report indicating ultra-wide PDFs cannot be loaded. The docs have been updated to reflect the changes necessary in the Imagick policy config file to allow loading these files.

Enhancements to PDF Handling:

  • Added support for ultra-wide PDFs by introducing changes to the Imagick policy configuration and documenting the process in the README.md. [1] [2]
  • Updated the Pdf class to initialize Imagick as nullable and replaced null checks with empty() for better readability and flexibility. [1] [2] [3]

Continuous Integration Workflow Improvements:

  • Updated the PHP matrix in .github/workflows/run-tests.yml to include PHP 8.4.
  • policy.xml file on the test runner is updated to allow for ultra-wide PDFs.
  • Enabled parallel execution for tests in the CI pipeline to improve performance.

Testing Enhancements:

  • Added utility functions (get_test_file, test_file, and output_file) in tests/Pest.php to streamline test file handling.
  • Introduced a new WidthTest.php file to validate support for ultra-wide and wide PDFs, ensuring proper functionality and output.

Other

  • Minor grammatical changes to docs & comments.

@patinthehat patinthehat requested a review from Copilot May 16, 2025 03:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces enhancements to PDF handling, updates the CI workflow for parallel testing and PHP 8.4 support, and adds new test utility functions.

  • Enhanced support for ultra-wide and wide PDFs with antialiasing improvements.
  • New test utilities and tests for PDF size validation.
  • Improved CI workflow including updated sed commands and parallel test execution.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Unit/WidthTest.php Added tests to validate ultra-wide and wide PDF dimensions.
tests/Pest.php Introduced utility functions for test file handling.
src/Pdf.php Updated PDF class to support nullable Imagick and antialiasing toggles.
README.md Added documentation for ultra-wide PDF policy configuration.
.github/workflows/run-tests.yml Updated PHP matrix, sed commands for Imagick policy, and enabled parallel tests.

@patinthehat patinthehat marked this pull request as ready for review May 16, 2025 04:02
@patinthehat patinthehat linked an issue May 16, 2025 that may be closed by this pull request
@patinthehat
Copy link
Collaborator Author

ping @freekmurze @sebastiandedeyne - need a quick review for this PR, as time permits. thanks! 👍

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.

Conversion error for really wide files Add Imagick’s Anti-Aliasing Support
1 participant