/[emacs]/emacs/lisp/thumbs.el
ViewVC logotype

Diff of /emacs/lisp/thumbs.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by lektu, Wed May 25 14:08:33 2005 UTC revision 1.12 by lektu, Mon May 30 09:41:49 2005 UTC
# Line 302  Or, alternatively, a SIZE may be specifi Line 302  Or, alternatively, a SIZE may be specifi
302    
303  (defun thumbs-thumbname (img)  (defun thumbs-thumbname (img)
304    "Return a thumbnail name for the image IMG."    "Return a thumbnail name for the image IMG."
305    (concat thumbs-thumbsdir "/"    (convert-standard-filename
306            (subst-char-in-string     (let ((filename (expand-file-name img)))
307             ?\  ?\_       (format "%s/%08x-%s.jpg"
308             (apply               thumbs-thumbsdir
309              'concat               (sxhash filename)
310              (split-string               (subst-char-in-string
311               (expand-file-name img) "/")))))                ?\s ?\_
312                  (apply
313                   'concat
314                   (split-string filename "/")))))))
315    
316  (defun thumbs-make-thumb (img)  (defun thumbs-make-thumb (img)
317    "Create the thumbnail for IMG."    "Create the thumbnail for IMG."
318    (let* ((fn (expand-file-name img))    (let ((fn (expand-file-name img))
319           (tn (thumbs-thumbname img)))          (tn (thumbs-thumbname img)))
320      (if (or (not (file-exists-p tn))      (if (or (not (file-exists-p tn))
321              ;;  This is not the right fix, but I don't understand              ;;  This is not the right fix, but I don't understand
322              ;;  the external program or why it produces a geometry              ;;  the external program or why it produces a geometry
# Line 378  If MARKED is non-nil, the image is marke Line 381  If MARKED is non-nil, the image is marke
381      (unless (bobp) (newline))))      (unless (bobp) (newline))))
382    
383  (defun thumbs-show-thumbs-list (L &optional buffer-name same-window)  (defun thumbs-show-thumbs-list (L &optional buffer-name same-window)
384    (when (not (display-images-p))    (unless (and (display-images-p)
385      (error "Images are not supported in this Emacs session"))                 (image-type-available-p 'jpeg))
386        (error "Required image type is not supported in this Emacs session"))
387    (funcall (if same-window 'switch-to-buffer 'pop-to-buffer)    (funcall (if same-window 'switch-to-buffer 'pop-to-buffer)
388             (or buffer-name "*THUMB-View*"))             (or buffer-name "*THUMB-View*"))
389    (let ((inhibit-read-only t))    (let ((inhibit-read-only t))

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26