aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2006-07-12 00:24:40 +0000
committerNick Roberts2006-07-12 00:24:40 +0000
commite194e890589673839e16dfebe649297c211395bb (patch)
tree6b371cb285ae9791e13cd6d77a55aadb3f2305cc
parentff77218157b4ccc3681d49e053cac4d3d4a0bd98 (diff)
downloademacs-e194e890589673839e16dfebe649297c211395bb.tar.gz
emacs-e194e890589673839e16dfebe649297c211395bb.zip
(tumme-create-thumb)
(tumme-thumbnail-display-external, tumme-display-image) (tumme-rotate-thumbnail, tumme-rotate-original) (tumme-set-exif-data, tumme-get-exif-data): Use shell-command-switch.
-rw-r--r--lisp/tumme.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/tumme.el b/lisp/tumme.el
index d97a5d0108f..26d48e77b2f 100644
--- a/lisp/tumme.el
+++ b/lisp/tumme.el
@@ -628,7 +628,7 @@ according to the Thumbnail Managing Standard."
628 (setq thumbnail-dir (file-name-directory thumbnail-file)))) 628 (setq thumbnail-dir (file-name-directory thumbnail-file))))
629 (message "Creating thumbnail directory.") 629 (message "Creating thumbnail directory.")
630 (make-directory thumbnail-dir)) 630 (make-directory thumbnail-dir))
631 (call-process shell-file-name nil nil nil "-c" command))) 631 (call-process shell-file-name nil nil nil shell-command-switch command)))
632 632
633;;;###autoload 633;;;###autoload
634(defun tumme-dired-insert-marked-thumbs () 634(defun tumme-dired-insert-marked-thumbs ()
@@ -1692,7 +1692,7 @@ Ask user how many thumbnails should be displayed per row."
1692 (message "No thumbnail at point") 1692 (message "No thumbnail at point")
1693 (if (not file) 1693 (if (not file)
1694 (message "No original file name found") 1694 (message "No original file name found")
1695 (call-process shell-file-name nil nil nil "-c" 1695 (call-process shell-file-name nil nil nil shell-command-switch
1696 (format "%s \"%s\"" tumme-external-viewer file)))))) 1696 (format "%s \"%s\"" tumme-external-viewer file))))))
1697 1697
1698;;;###autoload 1698;;;###autoload
@@ -1700,7 +1700,7 @@ Ask user how many thumbnails should be displayed per row."
1700 "Display file at point using an external viewer." 1700 "Display file at point using an external viewer."
1701 (interactive) 1701 (interactive)
1702 (let ((file (dired-get-filename))) 1702 (let ((file (dired-get-filename)))
1703 (call-process shell-file-name nil nil nil "-c" 1703 (call-process shell-file-name nil nil nil shell-command-switch
1704 (format "%s \"%s\"" tumme-external-viewer file)))) 1704 (format "%s \"%s\"" tumme-external-viewer file))))
1705 1705
1706(defun tumme-window-width-pixels (window) 1706(defun tumme-window-width-pixels (window)
@@ -1773,7 +1773,8 @@ original size."
1773 (cons ?h height) 1773 (cons ?h height)
1774 (cons ?f file) 1774 (cons ?f file)
1775 (cons ?t new-file)))) 1775 (cons ?t new-file))))
1776 (setq ret (call-process shell-file-name nil nil nil "-c" command)) 1776 (setq ret (call-process shell-file-name nil nil nil
1777 shell-command-switch command))
1777 (if (not (= 0 ret)) 1778 (if (not (= 0 ret))
1778 (error "Could not resize image"))) 1779 (error "Could not resize image")))
1779 (copy-file file new-file t)) 1780 (copy-file file new-file t))
@@ -1825,7 +1826,7 @@ With prefix argument ARG, display image in its original size."
1825 (cons ?p tumme-cmd-rotate-thumbnail-program) 1826 (cons ?p tumme-cmd-rotate-thumbnail-program)
1826 (cons ?d degrees) 1827 (cons ?d degrees)
1827 (cons ?t (expand-file-name file))))) 1828 (cons ?t (expand-file-name file)))))
1828 (call-process shell-file-name nil nil nil "-c" command) 1829 (call-process shell-file-name nil nil nil shell-command-switch command)
1829 ;; Clear the cache to refresh image. I wish I could just refresh 1830 ;; Clear the cache to refresh image. I wish I could just refresh
1830 ;; the current file but I do not know how to do that. Yet... 1831 ;; the current file but I do not know how to do that. Yet...
1831 (clear-image-cache)))) 1832 (clear-image-cache))))
@@ -1870,7 +1871,8 @@ overwritten. This confirmation can be turned off using
1870 (cons ?d degrees) 1871 (cons ?d degrees)
1871 (cons ?o (expand-file-name file)) 1872 (cons ?o (expand-file-name file))
1872 (cons ?t tumme-temp-rotate-image-file)))) 1873 (cons ?t tumme-temp-rotate-image-file))))
1873 (if (not (= 0 (call-process shell-file-name nil nil nil "-c" command))) 1874 (if (not (= 0 (call-process shell-file-name nil nil nil
1875 shell-command-switch command)))
1874 (error "Could not rotate image") 1876 (error "Could not rotate image")
1875 (tumme-display-image tumme-temp-rotate-image-file) 1877 (tumme-display-image tumme-temp-rotate-image-file)
1876 (if (or (and tumme-rotate-original-ask-before-overwrite 1878 (if (or (and tumme-rotate-original-ask-before-overwrite
@@ -1943,7 +1945,7 @@ default value at the prompt."
1943 (cons ?f (expand-file-name file)) 1945 (cons ?f (expand-file-name file))
1944 (cons ?t tag-name) 1946 (cons ?t tag-name)
1945 (cons ?v tag-value)))) 1947 (cons ?v tag-value))))
1946 (call-process shell-file-name nil nil nil "-c" command))) 1948 (call-process shell-file-name nil nil nil shell-command-switch command)))
1947 1949
1948(defun tumme-get-exif-data (file tag-name) 1950(defun tumme-get-exif-data (file tag-name)
1949 "From FILE, return EXIF tag TAG-NAME." 1951 "From FILE, return EXIF tag TAG-NAME."
@@ -1957,7 +1959,8 @@ default value at the prompt."
1957 (cons ?t tag-name)))) 1959 (cons ?t tag-name))))
1958 (with-current-buffer buf 1960 (with-current-buffer buf
1959 (delete-region (point-min) (point-max)) 1961 (delete-region (point-min) (point-max))
1960 (if (not (eq (call-process shell-file-name nil t nil "-c" command) 0)) 1962 (if (not (eq (call-process shell-file-name nil t nil
1963 shell-command-switch command) 0))
1961 (error "Could not get EXIF tag") 1964 (error "Could not get EXIF tag")
1962 (goto-char (point-min)) 1965 (goto-char (point-min))
1963 ;; Clean buffer from newlines and carriage returns before 1966 ;; Clean buffer from newlines and carriage returns before