Skip to content

🧪 ✨ swap out all PDF/Image handling features with Bernard L'Édit - #221

Open
sebastianMindee wants to merge 35 commits into
mainfrom
release-the-bernard
Open

sebastianMindee wants to merge 35 commits into
mainfrom
release-the-bernard

Conversation

@sebastianMindee

@sebastianMindee sebastianMindee commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • ✨ Swap-out pdf and image manipulation tools for in-house bernard-ledit.
  • 🐛 fix all bugs related to install of ghostscript/imagemagick.... by removing them
  • 🐛 fix a few tests and CI issues
  • ♻️ restore macOS & windows tests in unit tests

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires a change to the official Guide documentation.

@sebastianMindee sebastianMindee changed the title [DRAFT] ✨ swap out all PDF/Image handling capabilities by Bernard L'Édit [DRAFT] ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit Oct 8, 2026
@sebastianMindee sebastianMindee changed the title [DRAFT] ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit Oct 19, 2026
@sebastianMindee sebastianMindee changed the title ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit 🧪 ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit Oct 19, 2026
@sebastianMindee sebastianMindee changed the title 🧪 ✨ swap out all PDF/Image handling capabilities with Bernard L'Édit 🧪 ✨ swap out all PDF/Image handling features with Bernard L'Édit Oct 27, 2026
@sebastianMindee
sebastianMindee marked this pull request as ready for review October 27, 2026 17:13
@sebastianMindee
sebastianMindee requested a balanced review from Copilot October 27, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved workflow wiring, file-processing regressions, and missing-extension test coverage prevent safe approval.

11 open issues
What changed in this PR

This PR replaces the SDK’s Ghostscript, ImageMagick, and PHP PDF tooling with the optional Bernard L’Édit extension, consolidating PDF and image processing behind one native dependency.

Changes:

  • Migrates compression, page extraction, cropping, and PDF inspection to Bernard L’Édit.
  • Adds extension installation tooling and static-analysis stubs, and updates contributor documentation.
  • Revises tests and autoloading, expands cross-platform unit testing, and restores macOS integration testing.
File Description
tools/​update-bernard-ledit-stubs.sh Downloads extension stubs from a release.
tools/​install-bernard-ledit.sh Installs, verifies, or uninstalls the extension through PIE.
tests/​V2/​Search/​RagDocumentSearchTest.php Uses autoloaded test utilities.
tests/​V2/​Search/​ModelSearchTest.php Uses autoloaded test utilities.
tests/​V2/​Product/​SplitTest.php Removes manual utility loading.
tests/​V2/​Product/​SplitFunctional.php Removes manual utility loading.
tests/​V2/​Product/​OcrTest.php Removes manual utility loading.
tests/​V2/​Product/​OcrFunctional.php Removes manual utility loading.
tests/​V2/​Product/​Extraction/​RagDocumentsTest.php Removes manual utility loading.
tests/​V2/​Product/​Extraction/​RagDocumentsFunctional.php Removes manual utility loading.
tests/​V2/​Product/​Extraction/​ExtractionTest.php Removes manual utility loading.
tests/​V2/​Product/​CropTest.php Removes manual utility loading.
tests/​V2/​Product/​CropFunctional.php Removes manual utility loading.
tests/​V2/​Product/​ClassificationTest.php Removes manual utility loading.
tests/​V2/​Product/​ClassificationFunctional.php Removes manual utility loading.
tests/​V2/​Parsing/​JobResponseTest.php Removes manual utility loading.
tests/​V2/​Parsing/​FailedInferenceResponseTest.php Removes manual utility loading.
tests/​V2/​FileOperations/​SplitFunctional.php Groups extension-dependent tests and normalizes PDF comparisons.
tests/​V2/​FileOperations/​CropTest.php Checks crop dimensions through native decoding.
tests/​V2/​FileOperations/​CropFunctional.php Groups extension-dependent tests and adjusts size expectations.
tests/​V2/​Cli/​MindeeCliCommandV2TestFunctional.php Uses autoloaded CLI test utilities.
tests/​V2/​Cli/​MindeeCliCommandV2Test.php Uses autoloaded CLI test utilities.
tests/​V1/​Workflow/​WorkflowTestFunctional.php Removes manual utility loading.
tests/​V1/​Image/​InvoiceSplitterAutoExtractionTestFunctional.php Marks tests as extension-dependent.
tests/​V1/​Image/​ImageExtractorTest.php Checks encoded crop buffers instead of Imagick objects.
tests/​V1/​Http/​MindeeApiTest.php Handles an unset API-key environment variable.
tests/​V1/​Cli/​MindeeCliCommandTestFunctional.php Uses autoloaded test utilities.
tests/​V1/​Cli/​MindeeCliCommandTest.php Uses autoloading and a fallback test key.
tests/​TestingUtilities.php Resolves fixtures relative to the test directory.
tests/​Input/​LocalInputSourceTest.php Migrates PDF assertions and compression tests.
tests/​Dependencies/​DependencyCheckerPdfTest.php Checks Bernard L’Édit availability.
tests/​Dependencies/​DependencyCheckerNoExtendedTestPdf.php Removes legacy missing-dependency tests.
tests/​CustomSleepMixinTest.php Relaxes the timing tolerance.
tests/​ClientTest.php Handles an unset API-key environment variable.
tests/​bernardleditfeatures.xml Defines the missing-extension test suite.
stubs/​bernard_ledit.stubs.php Adds native API declarations for static analysis.
src/​V2/​Product/​Crop/​CropResult.php Assigns crop indexes per page.
src/​V2/​Product/​Crop/​CropItem.php Stores an optional per-page crop index.
src/​V2/​FileOperations/​CropFiles.php Handles native image encoding exceptions.
src/​V2/​FileOperations/​Crop.php Batches crops per page and preserves input order.
src/​V1/​Pdf/​PdfExtractor.php Updates exception documentation to name Bernard L’Édit.
src/​V1/​Client.php Uses an empty string when no API key is available.
src/​Pdf/​PdfUtils.php Replaces legacy helpers with native text detection.
src/​Pdf/​PdfExtractor.php Uses native PDF conversion and page extraction.
src/​Pdf/​PdfCompressor.php Removes the legacy PDF compressor.
src/​Pdf/​ExtractedPdf.php Counts pages through the native extension.
src/​Pdf/​CustomFpdi.php Removes the custom FPDI wrapper.
src/​Input/​LocalInputSource.php Migrates PDF operations and compression; adds file-size lookup.
src/​Image/​ImageUtils.php Removes Imagick utility methods.
src/​Image/​ImageExtractor.php Uses native polygon extraction and encoded crop buffers.
src/​Image/​ImageCompressor.php Wraps native image compression.
src/​Image/​ExtractedImage.php Stores encoded bytes and optionally re-encodes on save.
src/​Dependency/​DependencyChecker.php Replaces legacy checks with extension detection.
phpstan.neon Includes Bernard L’Édit stubs in analysis.
CONTRIBUTING.md Documents setup, testing, and extension maintenance.
composer.json Updates dependencies, test autoloading, and helper scripts.
.github/​workflows/​push-main-branch.yml Adds an extension-build workflow dependency.
.github/​workflows/​pull-request.yml Normalizes job dependency syntax.
.github/​workflows/​_test-units.yml Expands platform matrices and installs the extension.
.github/​workflows/​_test-integrations.yml Migrates dependency setup and restores macOS tests.
.github/​workflows/​_static-analysis.yml Checks out fixture submodules.

Review effort: Balanced

Comment thread .github/workflows/push-main-branch.yml Outdated
Comment thread src/Image/ImageExtractor.php Outdated
Comment thread src/V2/FileOperations/Crop.php
Comment thread src/Image/ExtractedImage.php Outdated
Comment thread src/Image/ImageExtractor.php
Comment thread src/Input/LocalInputSource.php
Comment thread src/Input/LocalInputSource.php Outdated
Comment thread src/Input/LocalInputSource.php Outdated
Comment thread src/Pdf/PdfUtils.php
Comment thread tests/Input/LocalInputSourceTest.php
sebastianMindee and others added 4 commits October 27, 2026 18:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

2 participants