(concord-images-add-url): Add optional arguments `prefix' and
authorMORIOKA Tomohiko <tomo.git@chise.org>
Thu, 6 Feb 2020 15:40:39 +0000 (00:40 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Thu, 6 Feb 2020 15:40:39 +0000 (00:40 +0900)
`prefer-iiif'.

concord-images.el

index 7597b07..2bb84c8 100644 (file)
      (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