[Top][All Lists]

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

Re: A few issues with thumbs.el

From: Juanma Barranquero
Subject: Re: A few issues with thumbs.el
Date: Thu, 26 May 2005 16:19:51 +0200

> 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")

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.


reply via email to

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