> Why not just
> 
>   (defun thumbs-thumbname (img)
>     "Return a thumbnail name for the image IMG."
>     (concat thumbs-thumbsdir "/"
>             (convert-standard-filename
>              (subst-char-in-string ?/ ?\| (expand-file-name img)))))

ELISP> (thumbs-thumbname "C:/store/test/ycbcr-cat.tif")
"c:/usr/home/.emacs-thumb/C:!store!test!ycbcr-cat.tif"

which is not a valid name (the ":"). In fact, that was the error that
took me down this path.

So you need either to substitute several chars, maybe with a regexp
function (possibly filesystem-dependant), or add
`subst-char-in-string' layers. And "store!test", for example, is a
perfectly valid file or directory name, so ambiguity still exists.

Much, much easier to just use md5().

> Of course you need to add a .jpg extension, like foo_bar.gif.jpg.

I can add it just fine, but the original thumbs code doesn't do it. It
preserves the filename's extension. Should be irrelevant anyway.

-- 
                    /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to