(www-image-default-base-directory): New variable.
authortomo <tomo>
Fri, 19 May 2006 10:35:14 +0000 (10:35 +0000)
committertomo <tomo>
Fri, 19 May 2006 10:35:14 +0000 (10:35 +0000)
(www-image-display-thumbnails): Get title from dir.desc; insert note feature
of dir.desc; use www-image-default-base-directory.

www-image.el

index 63695f1..bc727c8 100644 (file)
@@ -32,6 +32,9 @@
       'utf-8-jp-er
     'utf-8))
 
+(defvar www-image-default-base-directory
+  "../pub/pictures/")
+
 (defvar www-image-size-specs
   '((thumbnail  160  160)
     (QVGA       320  240)
 (defun www-image-display-thumbnails (url-dir &optional size image-root
                                             lang title parent-url)
   (setq url-dir (file-name-as-directory url-dir))
-  (unless title
-    (setq title
-         (file-name-nondirectory
-          (substring url-dir 0 (1- (length url-dir))))))
   (let* ((desc-file
          (expand-file-name "dir.desc"
                            (expand-file-name url-dir image-root)))
              (insert-file-contents desc-file)
              (read (current-buffer)))))
         source-images
-        file)
+        file
+        note)
+    (when (setq title (assq 'title params))
+      (setq title (cdr title)))
+    (unless title
+      (setq title
+           (file-name-nondirectory
+            (substring url-dir 0 (1- (length url-dir))))))
     (when (setq source-images (assq 'files params))
       (setq source-images (cdr source-images)))
+    (when (setq note (assq 'note params))
+      (setq note (cdr note)))
     (when (setq parent-url (assq 'exit params))
       (setq parent-url (cdr parent-url)))
     (with-temp-buffer
        (insert (format "<img alt=\"%s\" src=\"image.cgi?file=%s%s&size=thumbnail\">"
                        file url-dir file))
        (insert "</a>\n"))
+
+      (when note
+       (insert "<p>")
+       (insert note))
+
       (insert "
 
 <hr>
     (setq command-line-args-left (cdr command-line-args-left))
     (setq image-root (or (car command-line-args-left)
                         (expand-file-name
-                         "../data/photo/"
+                         www-image-default-base-directory
                          default-directory)))
     (setq command-line-args-left (cdr command-line-args-left))
     (cond (file