> It would be much better for the user if the thumbnail file names are > based on something meaningful, such as the user's file name (or at > least part of it). It is ok to add other info such as an md5 checksum > to make them unique, but please don't make them entirely meaningless.
I really don't understand why is that important; these files are not for human consumption. But I don't really care one way or the other. The real issue is not making them unique (although there's also a small problem with that), but making them valid. As it is on CVS, thumbs-thumbname does not produce valid MSDOS/Windows filenames. I think the following approach can work, but still is could break on non-Unix, non-Windows environments: (defun thumbs-thumbname (img) "Return a thumbnail name for the image IMG." (convert-standard-filename (let ((filename (expand-file-name img))) (format "%s/%s-%x.jpg" thumbs-thumbsdir (subst-char-in-string ?\s ?\_ (apply 'concat (split-string filename "/"))) (sxhash filename))))) -- /L/e/k/t/u _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel