From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: Thu, 26 May 2005 16:19:51 +0200 Message-ID: References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1117117459 19199 80.91.229.2 (26 May 2005 14:24:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 14:24:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 16:24:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbJFl-00065x-3G for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 16:22:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbJJp-0000pW-T6 for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 10:26:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbJI5-0000Cp-U3 for emacs-devel@gnu.org; Thu, 26 May 2005 10:24:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbJHy-000096-A0 for emacs-devel@gnu.org; Thu, 26 May 2005 10:24:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbJHw-00005F-3n for emacs-devel@gnu.org; Thu, 26 May 2005 10:24:44 -0400 Original-Received: from [64.233.184.193] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbJDs-0002Ib-C6 for emacs-devel@gnu.org; Thu, 26 May 2005 10:20:32 -0400 Original-Received: by wproxy.gmail.com with SMTP id 57so962363wri for ; Thu, 26 May 2005 07:19:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NMfYFyqutKn+Rx1G/C1OTm1QIK21shIJDJ6Eex5PmMVdFV0e+gY/Fb4j6KX0NMEPwN08U0/cYyDh+Fm6dZNf+P/5AXP1ymHSGqxs2idWgGplTsKS74ViEvnjYg/YBGEq1pqSinoFmi/1NJiiharvuJwArzc9iaLJkCwlM00EDG8= Original-Received: by 10.54.51.17 with SMTP id y17mr974862wry; Thu, 26 May 2005 07:19:51 -0700 (PDT) Original-Received: by 10.54.82.6 with HTTP; Thu, 26 May 2005 07:19:51 -0700 (PDT) Original-To: Stefan Monnier In-Reply-To: <87u0kqrsur.fsf-monnier+emacs@gnu.org> Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37702 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37702 > Why not just >=20 > (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. --=20 /L/e/k/t/u