(www-display-object-desc): Add code to display image in head for genre
[chise/est.git] / cwiki-view.el
index 8f55658..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)
@@ -203,7 +203,7 @@ li { margin: 0 0 0 2em; }
         (if (setq ret (concord-object-get object '=location@iiif))
             (if (setq base-image
                       (car (concord-object-get object '<-image-segment)))
-                (format "<a href=\"%s...$zoom-xywh=%d,%d,%d,%d\"
+                (format "<a href=\"%s...$.zoom-xywh=%d,%d,%d,%d\"
 ><img alt=\"%s\" src=\"%s\" /></a>"
                         (www-uri-encode-object base-image)
                         (concord-object-get object 'image-offset-x)
@@ -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))
@@ -765,7 +784,7 @@ size=\"30\" maxlength=\"30\" value=\"%s\" />"
                            (list (substring ret 0 (match-beginning 0))
                                  (substring ret (match-end 0)))
                            )
-                          ((string-match "...$zoom-xywh=" ret)
+                          ((string-match "...$.zoom-xywh=" ret)
                            (list (substring ret 0 (match-beginning 0))
                                  nil
                                  (substring ret (match-end 0)))