Hi guys. I'm trying to get metadata from image. I've created simple C++ project in Xcode, added Exif sources and added simple example.
int main(int argc, char **argv)
{
const char *path = "/Users/bbb/Desktop/raw_photos/thumb1.jpg";
// create our ExifTool object
ExifTool *et = new ExifTool();
// read metadata from the image
TagInfo *info = et->ImageInfo(path);
if (info) {
// print returned information
for (TagInfo *i=info; i; i=i->next) {
cout << i->name << " = " << i->value << endl;
}
// we are responsible for deleting the information when done
delete info;
} else if (et->LastComplete() <= 0) {
cerr << "Error executing exiftool!" << endl;
}
// print exiftool stderr messages
char *err = et->GetError();
if (err) cout << err;
delete et; // delete our ExifTool object
return 0;
}
Image url is correct, but ImageInfo returns NULL. I think the problem is that isRunning() is always returns 0. Probably, I've missed something, but can't figure out what.
I have no clue about how the c++ interface works, but if it keeps showing that exiftool isn't running, the first thing I would check would be to make sure that exiftool is in a path accessible by the system.
Edit: I see you figured out the problem. Original Stackoverflow question (https://stackoverflow.com/questions/51288144/exiftool-get-imageinfo).
Yes, thanks, I've managed to fix it :)