quagga2 icon indicating copy to clipboard operation
quagga2 copied to clipboard

Feature Request: Filename Generator Function for Sequence Mode in ImageLoader

Open ericblade opened this issue 3 months ago • 0 comments

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.

ericblade avatar Nov 26 '25 06:11 ericblade