I am using Swift to call Exiftool via a command line.
Anyone any ideas how to read in the return from a call that includes -b and returns binary data into a memory buffer in Swift?
Simple. Run ExifTool using the -stay_open option and with stdout tied to stdin in both directions.
Write your command arguments to from Swift to stdout, ending with -execute1234 (or whatever number you want).
Read stdin until you see "ready{1234}\n" (or whatever number you used) at the end of the output. The binary data is everything before this response string (if you used the -b option).
- Phil