js-upup / reference-image-batch-checker
Check local reference image batches for upload limits and identical files
Package info
github.com/airobushotpot/reference-image-batch-checker
pkg:composer/js-upup/reference-image-batch-checker
Requires
- php: >=8.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-20 05:10:37 UTC
README
Check a set of local source images before sending it to an image-to-image editor. The PHP library reports upload budget issues and catches identical files that would take up more than one reference slot.
Use
The library requires PHP 8.2 or later. Add the GitHub repository to Composer as a VCS source if you are using the Git tag directly.
composer config repositories.reference-image-batch-checker vcs https://github.com/airobushotpot/reference-image-batch-checker composer require js-upup/reference-image-batch-checker:^0.1
<?php require __DIR__ . '/vendor/autoload.php'; use ReferenceImageBatchChecker\BatchChecker; $report = BatchChecker::check( [__DIR__ . '/subject.jpg', __DIR__ . '/setting.webp'], maxFiles: 4, maxFileBytes: 5 * 1024 * 1024, maxBatchBytes: 12 * 1024 * 1024, ); if (!$report['accepted']) { print_r($report); }
The example uses local workflow limits. Set the limits for your own editor and model.
Checks
- Reports an empty batch, excess file count and excess combined size.
- Reports the size and detected header type of each readable file. The supported types are JPEG, PNG, WebP and AVIF.
- Uses SHA-256 to find byte-identical copies among files that pass the individual checks. Each later copy points to the first matching file by zero-based index.
The preflight reads image headers from local files you control. Renaming a file preserves its hash, and re-encoding it can change its hash. Your application handles pixel decoding, uploads and image editing.
Related workflow
For restyling or combining subjects with new settings, see the MiniMax H3 Image to Image workspace.