News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

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).
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

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?