From: tomo Date: Wed, 17 Oct 2007 10:45:54 +0000 (+0000) Subject: (www-page-directory-image-files): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f853666dc656bd9b961678f1a3bc650b07e40171;p=elisp%2Falbum.git (www-page-directory-image-files): New function. (www-page-display-dir): Use `www-page-directory-image-files'. (www-page-display-page): Likewise. --- diff --git a/www-page.el b/www-page.el index d06d497..c3cc4f1 100644 --- a/www-page.el +++ b/www-page.el @@ -78,6 +78,15 @@ (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)) @@ -100,8 +109,7 @@ (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)))