(concord-images-add-url): Use feature `image-width' and feature
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 29 Jun 2016 09:11:42 +0000 (18:11 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 29 Jun 2016 09:11:42 +0000 (18:11 +0900)
`image-height' instead of feature `width' and feature `height'.
(concord-images-add-segments): Likewise; use feature `image-offset-x'
and feature `image-offset-y' instead of `offset-x' and `offset-y'.

concord-images.el

index 3290595..84a6461 100644 (file)
          (goto-char (point-min))
          (when (re-search-forward
                 "^[ \t]*\"width\"[ \t]*:[ \t]*\\([0-9]+\\)" nil t)
-           (concord-object-put img-cobj 'width (string-to-int
-                                                (match-string 1))))
+           (concord-object-put img-cobj 'image-width
+                               (string-to-int (match-string 1))))
          (when (re-search-forward
                 "^[ \t]*\"height\"[ \t]*:[ \t]*\\([0-9]+\\)" nil t)
-           (concord-object-put img-cobj 'height (string-to-int
-                                                 (match-string 1))))
+           (concord-object-put img-cobj 'image-height
+                               (string-to-int (match-string 1))))
          ))
       (when iip
        (concord-object-put img-cobj '=location@iip iip))
                          (format "%s#xywh=%d,%d,%d,%d"
                                  (concord-object-get base-cobj '=location)
                                  x y width height))
-      (concord-object-put seg-cobj 'offset-x x)
-      (concord-object-put seg-cobj 'offset-y y)
-      (concord-object-put seg-cobj 'width width)
-      (concord-object-put seg-cobj 'height height)
+      (concord-object-put seg-cobj 'image-offset-x x)
+      (concord-object-put seg-cobj 'image-offset-y y)
+      (concord-object-put seg-cobj 'image-width width)
+      (concord-object-put seg-cobj 'image-height height)
       (setq seg-iiif-url (format "%s/%d,%d,%d,%d/full/0/default.jpg"
                                 base-iiif-url x y width height))
       (concord-object-put seg-cobj '=location@iiif seg-iiif-url)
       (when (setq base-iip-url (concord-object-get base-cobj '=location@iip))
-       (setq base-width (concord-object-get base-cobj 'width)
+       (setq base-width (concord-object-get base-cobj 'image-width)
              base-width-f (float base-width)
-             base-height-f (float (concord-object-get base-cobj 'height)))
+             base-height-f (float
+                            (concord-object-get base-cobj 'image-height)))
        (setq rel-x (/ x base-width-f)
              rel-y (/ y base-height-f)
              rel-w (/ width base-width-f)