help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h-e-w] Thumbs.el problem with temp filename generation on Windows


From: rob . davenport
Subject: [h-e-w] Thumbs.el problem with temp filename generation on Windows
Date: Wed, 6 Oct 2004 10:43:01 -0400

I was exploring Mssr. Theberge's package "thumbs.el"[1] 
with the new pre-release Emacs that supports JPG formats[2]
and noticed it wasn't working quite correctly on Windows. 
Some monitoring of file accesses showed it was forming bad 
filenames when passing the names for thumbnails to the 
convert program (ImageMagick).
I modified the function thumbs-thumbname, adding the call 
to file-relative-name:

(file-relative-name (expand-file-name img)) "/")))))
    ;; instead of    (expand-file-name img) "/")))))

Just using expand-file-name was creating thumbnames with 
embedded drive letters which don't work. So by changing that, 
I now get most of the functionality (though it seems 
multiple operations on an image don't stack - they start 
from the original image - I couldn't resize and then rotate 
an image, but that's another issue).

The modified function:

(defun thumbs-thumbname (img)
  "Return a thumbnail name for the image IMG."
  (concat thumbs-thumbsdir "/"
          (thumbs-subst-char-in-string
           ?\  ?\_
           (apply
            'concat
            (split-string
             (file-relative-name (expand-file-name img)) "/")))))

So, is that a reasonable fix or should this function be 
doing something else (better) on Windows?

Thanks,

Rob Davenport

[1] <http://www.emacswiki.org/cgi-bin/emacs/ThumbsMode>
[2] <http://nqmacs.sourceforge.net/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]