I am writing a macro and at the end I want to run
exiftool to copy metadata from one image to another. I have it working but a colleague asked me to make it work with spaces in directory paths and now I’m stuck. This is the line giving me problems:
exec(exiftoolDirectory + "exiftool -tagsfromfile " + "\"" + inDirectory + filesToProcess[i] + "\"" + " " + "\"" + outDirectory + outputFileName + "\"");
The exiftool needs double-quotes if the path has spaces. The string created within the exec function is:
exiftool -tagsfromfile "/media/nedhorning/684EE5FF4EE5C642/AMNH/PhotoMonitoring/Vignetting/test image/2016_0401_105800_094.JPG" "/media/nedhorning/684EE5FF4EE5C642/AMNH/PhotoMonitoring/Vignetting/output image/2016_0401_105800_094.jpg"
When I run this on the command line in Ubuntu it works just fine. So to me it seems like the string concatenation in the exec() function is formed properly for exiftool but something must be happening before the command is passed by ImageJ to the system.
Any help would be appreciated.