(www-page-directory-image-files): New function.
authortomo <tomo>
Wed, 17 Oct 2007 10:45:54 +0000 (10:45 +0000)
committertomo <tomo>
Wed, 17 Oct 2007 10:45:54 +0000 (10:45 +0000)
(www-page-display-dir): Use `www-page-directory-image-files'.
(www-page-display-page): Likewise.

www-page.el

index d06d497..c3cc4f1 100644 (file)
              (insert-file-contents desc-file)
              (read (current-buffer)))))))
 
+(defun www-page-directory-image-files (url-dir image-root)
+  (let (source-images)
+    (dolist (file (directory-files (expand-file-name url-dir image-root)
+                                  nil "\\.\\(jpg\\|JPG\\)$" nil t))
+      (unless (string-match "_[^_]+GA[^_]*$"
+                           (file-name-sans-extension file))
+       (setq source-images (cons file source-images))))
+    (nreverse source-images)))
+      
 (defun www-page-display-dir (url-dir &optional size image-root
                                     lang title parent-url hide-cgi)
   (setq url-dir (file-name-as-directory url-dir))
       (setq ref-images (cdr ref-images)))
     (unless (or source-images ref-images)
       (setq source-images
-           (directory-files (expand-file-name url-dir image-root)
-                            nil "\\.\\(jpg\\|JPG\\)$" nil t)))
+           (www-page-directory-image-files url-dir image-root)))
     (when (setq note (assq 'note params))
       (setq note (cdr note)))
     (when (setq parent-url (assq 'exit params))
@@ -264,10 +272,8 @@ Powered by MnjAlbum WWW-Page Version %s." www-page-version))
          (if (setq rest (assq 'files params))
              (setq rest (cdr rest))
            (setq rest
-                 (directory-files
-                  (expand-file-name (file-name-directory file)
-                                    image-root)
-                  nil "\\.\\(jpg\\|JPG\\)$" nil t)))
+                 (www-page-directory-image-files
+                  (file-name-directory file) image-root)))
          (setq ret (file-name-nondirectory file))
          (while (and rest
                      (not (string= (car rest) ret)))