summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-06-14 00:18:24 +0530
committerArun Isaac2017-06-14 00:18:24 +0530
commit5257d3b3f70a9d3580fd0ce81b73d9427ff45143 (patch)
tree1e2d779382c48f7a0420d221529c0741ca4ce7ee
parentf0a2e91f49758f0e12310f9961386fe95fb579e4 (diff)
downloadexiftool.el-5257d3b3f70a9d3580fd0ce81b73d9427ff45143.tar.gz
exiftool.el-5257d3b3f70a9d3580fd0ce81b73d9427ff45143.tar.lz
exiftool.el-5257d3b3f70a9d3580fd0ce81b73d9427ff45143.zip
Use regexp to extract tag and value.
* exiftool.el (exiftool-read): Use `string-match' with regexp to extract tag and value. Previous this change, `exiftool-read' failed to correctly handle tags whose value contained a ":".
-rw-r--r--exiftool.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/exiftool.el b/exiftool.el
index 77d829d..e477ed9 100644
--- a/exiftool.el
+++ b/exiftool.el
@@ -86,10 +86,10 @@ value. If no TAGS are specified, read all tags from FILE.
\(fn FILE TAG...)"
(mapcar
(lambda (line)
- (cl-destructuring-bind
- (tag value) (split-string line ": ")
- (let ((value (if (equal value "-") "" value)))
- (cons tag value))))
+ (string-match "\\([^:]*\\): \\(.*\\)" line)
+ (let ((tag (match-string 1 line))
+ (value (match-string 2 line)))
+ (cons tag (if (equal value "-") "" value))))
(split-string
(apply 'exiftool-command
"-s" "-s" "-f"