;;; thumbs.el --- Thumbnails previewer for images files
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca>
;; Maintainer: FSF
:version "22.1"
:group 'multimedia)
-(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
- "*Directory to store thumbnails."
+(defcustom thumbs-thumbsdir (locate-user-emacs-file "thumbs")
+ "Directory to store thumbnails."
:type 'directory
:group 'thumbs)
(defcustom thumbs-geometry "100x100"
- "*Size of thumbnails."
+ "Size of thumbnails."
:type 'string
:group 'thumbs)
"convert.exe"
(or (executable-find "convert")
"/usr/X11R6/bin/convert"))
- "*Name of conversion program for thumbnails generation.
+ "Name of conversion program for thumbnails generation.
It must be 'convert'."
:type 'string
:group 'thumbs)
:group 'thumbs)
(defcustom thumbs-relief 5
- "*Size of button-like border around thumbnails."
+ "Size of button-like border around thumbnails."
:type 'integer
:group 'thumbs)
(defcustom thumbs-margin 2
- "*Size of the margin around thumbnails.
+ "Size of the margin around thumbnails.
This is where you see the cursor."
:type 'integer
:group 'thumbs)
(let ((fattribs-list (file-attributes f)))
`(,(nth 4 fattribs-list) ,(nth 7 fattribs-list) ,f)))
(directory-files (thumbs-thumbsdir) t (image-file-name-regexp)))
- '(lambda (l1 l2) (time-less-p (car l1) (car l2)))))
+ (lambda (l1 l2) (time-less-p (car l1) (car l2)))))
(dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files-list))))
(while (> dirsize thumbs-thumbsdir-max-size)
(progn
((string-match ".*\\.png\\'" img) 'png)
((string-match ".*\\.tiff?\\'" img) 'tiff)))
+(declare-function image-size "image.c" (spec &optional pixels frame))
+
(defun thumbs-file-size (img)
(let ((i (image-size
(find-image `((:type ,(thumbs-image-type img) :file ,img))) t)))
(provide 'thumbs)
-;; arch-tag: f9ac1ef8-83fc-42c0-8069-1fae43fd2e5c
;;; thumbs.el ends here