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: Sat, 28 May 2005 20:00:05 +0200 Message-ID: References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> <87hdgon2p2.fsf@jurta.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 1117303449 21809 80.91.229.2 (28 May 2005 18:04:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 May 2005 18:04:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 20:04:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dc5fB-0002Ae-7G for ged-emacs-devel@m.gmane.org; Sat, 28 May 2005 20:03:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dc5jh-0003Rk-Fs for ged-emacs-devel@m.gmane.org; Sat, 28 May 2005 14:08:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dc5id-0002nA-GP for emacs-devel@gnu.org; Sat, 28 May 2005 14:07:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dc5ia-0002ly-Sl for emacs-devel@gnu.org; Sat, 28 May 2005 14:07:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dc5ia-0002jE-KV for emacs-devel@gnu.org; Sat, 28 May 2005 14:07:28 -0400 Original-Received: from [64.233.184.200] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dc5ca-0007wN-OB for emacs-devel@gnu.org; Sat, 28 May 2005 14:01:16 -0400 Original-Received: by wproxy.gmail.com with SMTP id 50so1234788wri for ; Sat, 28 May 2005 11:00:05 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g0YQUE4wP0u7Eti0Bi9rqkoj7aqot0Cgbo3DwNDb7DC3vZbMSe5GBsrh0qg6qXKkclJSTKDp184WxVgLuXL95tLYwOqoWSuKsrNEinq75zGcsqRY1t52Gj8kyrTKh0S8PuoEk2H+ir1vVMvsbrHhwKNoxQO8KF+5yCwsdwo7f/Q= Original-Received: by 10.54.71.17 with SMTP id t17mr2101294wra; Sat, 28 May 2005 11:00:05 -0700 (PDT) Original-Received: by 10.54.82.6 with HTTP; Sat, 28 May 2005 11:00:05 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: 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:37830 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37830 > 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))))) --=20 /L/e/k/t/u