Exiftool in C++. Send result through pipe

Started by dybydx, March 22, 2022, 01:20:37 AM

Previous topic - Next topic

dybydx

I am translating the following command in C++:

exiftool -RawThermalImage -b imagename.jpg | convert - -compress none tester.pgm


This is what I have written for the Exiftool part:

ExifTool* et = new ExifTool();
TagInfo* info = et->ImageInfo(imagename.jpg, "-RawThermalImage -b");


For the ImageMagick part I have written the following:


Image inputImage;
inputImage.read(); //to complete
//compress
inputImage.compressType(NoCompression);
//write
inputImage.write("tester.pgm");


The problem is that I do not know how to translate the pipe in the script to join these 2 sections of code. As you can see the read function of the ImageMagick object is empty, as I don't know what to put into it. I am not sure if I can directly put 'info' there. Kindly guide. Thanx in advance.

StarGeek

I don't know c programming at all, but I think what you want is imagemagick BLOB.  The TagInfo should contain the extracted image.  You then create and copy that data to a BLOB and then inputImage.read(blob).
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dc@eicx.com

Could you be a bit more clear what you are trying to do.

Are you trying to call exiftool.exe from your program and write / read to std in and out via pipes?