(www-display-object-desc): Add code to display image in head for genre
authorMORIOKA Tomohiko <tomo.git@chise.org>
Tue, 28 Jun 2016 07:58:28 +0000 (16:58 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Tue, 28 Jun 2016 07:58:28 +0000 (16:58 +0900)
`glyph-image'.

cwiki-view.el

index 04f7f36..3a76163 100644 (file)
@@ -69,7 +69,7 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
        logical-feature chise-wiki-displayed-features
        parents
        GlyphWiki-id HNG-card ret object-spec
-       width height base-image x y w h)
+       width height image-cobj base-image x y w h)
     (if (eq level 0)
        (setq level 1
              without-header nil)
@@ -271,6 +271,25 @@ li { margin: 0 0 0 2em; }
           (format "<img alt=\"%s\" src=\"%s\" />"
                   ret ret)))
        )
+       ((and (eq genre 'glyph-image)
+            (setq image-cobj
+                  (car (concord-object-get object '->image-resource))))
+       (if (and (setq ret (concord-object-get image-cobj '=location@iiif))
+                (setq base-image
+                      (car (concord-object-get image-cobj '<-image-segment))))
+           (princ
+            (format "<a href=\"../image-resource/%s...$.zoom-xywh=%d,%d,%d,%d\"
+><img alt=\"%s\" src=\"%s\" /></a>"
+                    (www-uri-encode-object base-image)
+                    (concord-object-get image-cobj 'image-offset-x)
+                    (concord-object-get image-cobj 'image-offset-y)
+                    (concord-object-get image-cobj 'image-width)
+                    (concord-object-get image-cobj 'image-height)
+                    ret ret))
+         (setq ret (concord-object-get image-cobj '=location))
+         (princ (format "<img alt=\"%s\" src=\"%s\" />"
+                        ret ret)))
+       )
        ((and (eq genre 'hng-card)
             (setq ret (concord-object-get object '=hng-card))
             (setq ret (symbol-name ret))