From: tomo Date: Wed, 3 Oct 2007 08:01:46 +0000 (+0000) Subject: (www-page-size-specs): Add new spec `original'. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a6b4fa99f63d5daefa2b3e9c5758140f98dd82c;p=elisp%2Falbum.git (www-page-size-specs): Add new spec `original'. (www-page-display-image): Support original size. --- diff --git a/www-page.el b/www-page.el index 9d1f04b..1fe9441 100644 --- a/www-page.el +++ b/www-page.el @@ -1,6 +1,6 @@ ;;; www-page.el --- Album page generator for page.cgi. -;; Copyright (C) 2005,2006 MORIOKA Tomohiko +;; Copyright (C) 2005,2006,2007 MORIOKA Tomohiko ;; Keywords: Photo, image, album, HTML, WWW @@ -49,6 +49,7 @@ (WUXGA 1920 1200) (QXGA 2048 1536) (WQXGA 2560 1600) + (original nil nil) )) (defun decode-url-string (string &optional coding-system) @@ -414,7 +415,7 @@ (when (file-exists-p file) (let (file-dir file-name resized-file resized-dir - spec) + spec width height) (cond (size (setq file-dir (file-name-directory file) @@ -427,7 +428,9 @@ size file-dir)))) (unless (file-exists-p resized-file) (setq size (intern size)) - (if (setq spec (assq size www-page-size-specs)) + (if (and (setq spec (assq size www-page-size-specs)) + (setq width (nth 1 spec)) + (setq height (nth 2 spec))) (progn (condition-case nil (unless (file-exists-p resized-dir) @@ -435,7 +438,7 @@ (error nil)) (call-process "convert" nil nil nil - "-resize" (format "%dx%d>" (nth 1 spec)(nth 2 spec)) + "-resize" (format "%dx%d>" width height) file resized-file) ) (setq resized-file file)))