Translate an Exiftool command to Exiftool in C++

I want to translate an Exfitool terminal command to the Exiftool C++ wrapper code.

The command is as follows:

exiftool -RawThermalImage -b imageIn.jpg > imageOut.png


I have written the following code so far:

1
2
ExifTool* imageIn = new ExifTool();
TagInfo* information = imageIn->ImageInfo(imageIn.jpg, "-RawThermalImage -b");


But I am not able to understand, how I can translate the > imageOut.png part. Kindly guide.
Thanks.
Last edited on
But I am not able to understand, how I can translate the > imageOut.png part. Kindly guide.

This part of the command simple tells the shell to redirect the stdout of the exiftool program to a file.

Inside your own C/C++ program, you can simple use a combination of fopen() and fwrite() to write the output to whichever file that you desire. Your program may take the name of the output file as a command-line parameter, if you don't want to "hard-code" the file name. Well, either that, or write the output to stdout (by using fwrite(stdout, ...)) and let the caller of your program redirect the output to the desired file....
Last edited on
Topic archived. No new replies allowed.