From 2446802b78582719337389121abee8c03c6798bb Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Fri, 7 Feb 2020 00:40:39 +0900 Subject: [PATCH] (concord-images-add-url): Add optional arguments `prefix' and `prefer-iiif'. --- concord-images.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/concord-images.el b/concord-images.el index 7597b07..2bb84c8 100644 --- a/concord-images.el +++ b/concord-images.el @@ -28,11 +28,16 @@ (t url)))) -(defun concord-images-add-url (url &optional iiif iip base) +(defun concord-images-add-url (url &optional iiif iip base prefix prefer-iiif) (let (img-id img-cobj) (unless (setq img-cobj (concord-decode-object '=location url 'image-resource)) - (setq img-id (intern (concord-images-encode-url-as-id url base))) + (setq img-id + (intern + (concat prefix + (if prefer-iiif + (concord-images-encode-url-as-id iiif base) + (concord-images-encode-url-as-id url base))))) (setq img-cobj (concord-make-object 'image-resource img-id)) (concord-object-put img-cobj '=location url) (when iiif -- 1.7.10.4