NullPointerException when using Stitching plugin

Hi all,

I am currently using Fiji to run some image stitching for my application, using the Grid/Collection stitching plugin.

This was created in a macro (.ijm), which I was able to run directly from within Fiji without any problem, resulting in a fused image being saved. Some stitching parameters like the Grid size X and Y, and overlap % are loaded from a separate text file.
StitchMacro.ijm.txt (1.4 KB)

Next, I attempted to run the macro from another application (NI LabVIEW) by calling Fiji in headless mode. The command line looks like this:
“C:\Fiji.app\ImageJ-win64.exe” --ij2 --headless --console -macro “C:\StitchMacro.ijm”

In this mode, the execution encountered a NullPointerException right after populating metadata and parsing the JPEG EXIF data for the first tile image.

As a side test, I converted the tile images to PNG format, modified the stitching to use PNG files as input, but encountered the same NullPointerException, this time right after loading the first tile image, but without populating metadata and parsing EXIF data.

Does anyone have an idea why the stitching macro works only in Fiji GUI, but not during headless operation? And if there is a way to resolve this?

Thank you!

Best regards,
Victor