Repository navigation
🧪 ✨ swap out all PDF/Image handling features with Bernard L'Édit - #221
Open
sebastianMindee wants to merge 35 commits into
Open
sebastianMindee wants to merge 35 commits into
sebastianMindee wants to merge 35 commits into
Conversation
sebastianMindee
force-pushed
the
release-the-bernard
branch
from
October 14, 2026 14:47
8bb7c3d to
109fb58
Compare
sebastianMindee
force-pushed
the
release-the-bernard
branch
from
October 27, 2026 10:49
e1813b1 to
bcf807a
Compare
sebastianMindee
force-pushed
the
release-the-bernard
branch
from
October 27, 2026 17:03
37317e4 to
a2b467f
Compare
sebastianMindee
marked this pull request as ready for review
October 27, 2026 17:13
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved workflow wiring, file-processing regressions, and missing-extension test coverage prevent safe approval.
11 open issues
Reference missing reusable workflow · New Cache input source for repeated extraction · New Prevent crop index collisions · New Handle image write failures · New Batch V1 image extraction to avoid repeated rendering · New Check optional extension before compression · New Update upload metadata after JPEG compression · New Normalize nullable page indexes before native call · New Use filesize instead of reading the entire document · New Check dependency before source-text detection · New Re-enable direct compressor wrapper coverage · New
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
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This branch has not been deployed
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
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.


Description
Types of changes