1

I'm trying to extract image metadata in my Objective-C project via Exiftool C++ interface. Code:

const char *fileName = "/Users/bbb/Desktop/photos/thumb1.jpg";
TagInfo *info = _tool->ImageInfo(fileName, NULL, 5);
NSLog(@"%@", info);

After some debugging I've found out that isRunning == 0 and Command isn't executed – return with -1

int ExifTool::Command(const char *cmd)
{
    int n;
    // check to make sure our exiftool process is still running
    int isRunning = IsRunning();
    if (!isRunning) return -1;
...

URL is valid and info here is NULL. What am I doing wrong? Thanks.

1 Answer 1

0

I've figured out what's wrong. Changed from this:

ExifTool *_tool = new ExifTool();

to:

ExifTool *_tool = new ExifTool([exifExecPath cStringUsingEncoding: NSASCIIStringEncoding]);

Where exifExecPath is exact location of exiftool exec file – /usr/local/bin in my case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.