Search by

js-upup / reference-image-batch-checker

js-upup

Check local reference image batches for upload limits and identical files

Package info

github.com/airobushotpot/reference-image-batch-checker

Homepage

pkg:composer/js-upup/reference-image-batch-checker

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-20 01:58 UTC

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.