Extract dates exif of images at c++ in variables
<p>I need optimize this code. Currently, this code works. I can extract the datetimeoriginal tag in a file using the extern tool "exiftool". But this is too slow when this process is repeated. is there a way the extract this information in variables directly?</p>

<pre><code>void image::add_info_creation_date(char *name_jpg){  
//Execute exiftool in bash
stringstream ss;
ss &lt;&lt; "exiftool.exe -datetimeoriginal -timezone images\\" &lt;&lt; name_jpg &lt;&lt; " &gt;&gt; temporal.txt";
error = system(ss.str().c_str());
if (error != 0){
    printf("The value returned was: %d.\n", error);
    ss.clear();
    exit(1);
}
ss.clear();
...
}
</code></pre>

<p>Sorry for my grammar, i am not native english speaker.</p>