aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-02-27 23:22:53 +0530
committerArun Isaac2017-02-27 23:22:53 +0530
commite3e7142e16d2bda0d5670f55057deb694c97e102 (patch)
treeda7ba347f1fe70c017814a22f5ae3786e3d5e656
parent22dfd7ec956885e36bfdd12ab98d1aa43ebfde4b (diff)
downloadexiftool.el-e3e7142e16d2bda0d5670f55057deb694c97e102.tar.gz
exiftool.el-e3e7142e16d2bda0d5670f55057deb694c97e102.tar.lz
exiftool.el-e3e7142e16d2bda0d5670f55057deb694c97e102.zip
Support copying specific tags.
* el-exiftool.el (el-exiftool-copy): Support copying specific tags with the &rest `tags' argument.
-rw-r--r--el-exiftool.el15
1 files 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)