From e3e7142e16d2bda0d5670f55057deb694c97e102 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 27 Feb 2017 23:22:53 +0530 Subject: Support copying specific tags. * el-exiftool.el (el-exiftool-copy): Support copying specific tags with the &rest `tags' argument. --- el-exiftool.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/el-exiftool.el b/el-exiftool.el index aea4ba8..4f6851b 100644 --- a/el-exiftool.el +++ b/el-exiftool.el @@ -89,11 +89,16 @@ value. If no TAGS are specified, read all tags from FILE. (list file))) "\n+"))) -(defun el-exiftool-copy (source destination) - "Copy tags from SOURCE file to DESTINATION file." - (el-exiftool-command "-overwrite_original" - "-tagsFromFile" source - "-all:all" destination) +(defun el-exiftool-copy (source destination &rest tags) + "Copy TAGS from SOURCE file to DESTINATION file. + +If no TAGS are specified, copy all tags from SOURCE." + (apply 'el-exiftool-command + "-overwrite_original" + "-tagsFromFile" source + (append + (mapcar (apply-partially 'format "-%s") tags) + (list "-all:all" destination))) (message "Tags from %s copied to %s" source destination) destination) -- cgit v1.2.3