From: MORIOKA Tomohiko Date: Thu, 6 Feb 2020 15:40:39 +0000 (+0900) Subject: (concord-images-add-url): Add optional arguments `prefix' and X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2446802b78582719337389121abee8c03c6798bb;p=chise%2Fconcord-images.git (concord-images-add-url): Add optional arguments `prefix' and `prefer-iiif'. --- 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