-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunExiftool.m
More file actions
36 lines (30 loc) · 944 Bytes
/
Copy pathrunExiftool.m
File metadata and controls
36 lines (30 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
%
%% runExiftool
%
% Invokes exiftool executable
%
% _Parameters_
% * argStr - String containing command line options to pass to exiftool
%
% _Return Values_
% * exitCode - Process exit code from exiftool (0 = success)
% * output - stdout from exiftool
%
function [exitCode, output] = runExiftool(argStr)
% set exiftoolPath to the full path to your exiftool, including executable name.
% if exiftool is in your system path then you can set exiftoolPath to simply
% 'exiftool'
if (ismac)
exiftoolPath = '/usr/local/bin/exiftool';
else
exiftoolPath = 'exiftool';
end
% construct full command line to invoke exiftool and its parameters
fullCmdLine = [exiftoolPath ' ' argStr];
% invoke exiftool
[exitCode, output] = system(fullCmdLine);
% display error message if exiftool returned error status
if (exitCode ~= 0)
fprintf('runExiftool: Error exit status (%d) for: %s\n', exitCode, fullCmdLine);
end
end