From b99c161c985726f76c9f93b45c14db10d2198b43 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 23 Feb 2017 00:52:18 +0530 Subject: Return empty string for missing tags. * el-exiftool.el (el-exiftool-read): Handle case when tag is not found. Force exiftool to print missing tags, and replace their values with an empty string. --- el-exiftool.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'el-exiftool.el') diff --git a/el-exiftool.el b/el-exiftool.el index dd4081b..c68664b 100644 --- a/el-exiftool.el +++ b/el-exiftool.el @@ -70,10 +70,13 @@ to the exiftool command line application." \(fn FILE TAG...)" (mapcar (lambda (line) - (apply 'cons (split-string line ": "))) + (cl-destructuring-bind + (tag value) (split-string line ": ") + (let ((value (if (equal value "-") "" value))) + (cons tag value)))) (split-string (apply 'el-exiftool-command - "-s" "-s" + "-s" "-s" "-f" (append (mapcar (apply-partially 'format "-%s") tags) (list file))) -- cgit v1.2.3