Skip to content

Feature Request: Filename Generator Function for Sequence Mode in ImageLoader #596

Description

@ericblade

Allow ImageLoader sequence mode to accept a filename generator function via the Quagga configuration. This function would be passed to ImageLoader and used to generate filenames for each image in the sequence, enabling support for mixed extensions (e.g., .jpg, .png) and custom naming schemes. If not provided, the loader should default to the current .jpg logic.

Example config:

inputStream: {
  sequence: true,
  sequenceFilenameGenerator: (directory, num, idx) => {
    const ext = num === 11 ? '.png' : '.jpg';
    return `${directory}image-${num.toString().padStart(3, '0')}${ext}`;
  }
}

Implementation notes:

Update ImageLoader to accept the function.
Update Quagga's public interface to forward it.
Ensure backward compatibility.
Motivation:
This would make sequence mode more flexible for real-world and test scenarios, allowing loading of images with mixed extensions and custom naming patterns.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions