我正在尝试通过Exiftool C++接口提取目标-C项目中的图像元数据。代码:
const char *fileName = "/Users/bbb/Desktop/photos/thumb1.jpg";
TagInfo *info = _tool->ImageInfo(fileName, NULL, 5);
NSLog(@"%@", info);经过一些调试后,我发现isRunning == 0和Command没有被执行--随-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是有效的,这里的信息是NULL。我做错了什么?谢谢。
发布于 2018-07-12 10:41:00
我已经弄清楚出了什么问题。与此不同的是:
ExifTool *_tool = new ExifTool();至:
ExifTool *_tool = new ExifTool([exifExecPath cStringUsingEncoding: NSASCIIStringEncoding]);在我的例子中,exifExecPath是exiftool文件的确切位置- /usr/local/bin。
https://stackoverflow.com/questions/51288144
复制相似问题