From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: 12 Jun 2005 11:01:18 +0200 Message-ID: References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> <87hdgon2p2.fsf@jurta.org> <87vf508myc.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118569000 21934 80.91.229.2 (12 Jun 2005 09:36:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Jun 2005 09:36:40 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 12 11:36:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DhOtP-0004qJ-Uq for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 11:36:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhOxy-0001Le-Ef for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 05:41:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DhOcW-0006re-KC for emacs-devel@gnu.org; Sun, 12 Jun 2005 05:19:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DhOcQ-0006r4-A2 for emacs-devel@gnu.org; Sun, 12 Jun 2005 05:19:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhOLs-0005UD-W0 for emacs-devel@gnu.org; Sun, 12 Jun 2005 05:01:57 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DhOMY-0007Pm-Di for emacs-devel@gnu.org; Sun, 12 Jun 2005 05:02:38 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DhOHD-0001Xf-Bu for emacs-devel@gnu.org; Sun, 12 Jun 2005 10:57:07 +0200 Original-Received: from 1-1-3-38a.gml.gbg.bostream.se ([82.182.110.147]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 12 Jun 2005 10:57:07 +0200 Original-Received: from brakjoller by 1-1-3-38a.gml.gbg.bostream.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 12 Jun 2005 10:57:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 47 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 1-1-3-38a.gml.gbg.bostream.se User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 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:38623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38623 Stefan Monnier writes: > - I wish there was a way to put the thumbs directly next to the original > image files. E.g. instead of ~/.emacs-thumbs/foo!bar!baz!toto!NNNN.jpg > I'd like to use ~/foo/bar/baz/.emacs-thumbs/toto_NNNN.jpg. What are the benefits of doing this? I think it would litter the system with extra directories. I can see how it could solve the uniqueness-problem, not needing to add a hash anymore, but I don't know how big a problem that is (see discussion below). About thumbnail file naming: Currently, in tumme.el, I use a very simple way for creating the thumbnail file name: my_picture.jpg => ~/.tumme/my_picture.thumb.jpg my_other_picture.png => ~/.tumme/my_other_picture.thumb.jpg It works on my system because I have seen to it, by adding the images' EXIF DateTime-value to it, that all my images have unique file names, but I can see that is not likely on all user's setups. The potential for collisions will vary from one system to the other; some might have unique names like me, some might have a structure where they rely on the path to make the files unique. I think adding a hash at the end of the file name would be OK. Something like this, which is a slightly changed version of Juri's suggestion would be nice: (format "%s/%s-%x.jpg" thumbnail-directory (file-name-nondirectory filename) (sxhash filename)) The above would not work well for those that have many images with the same file name though, if they need to identify their images' thumbnail files. Btw, does anyone else agree with me that using something else than JPEG as thumbnail image format is a bad idea? I have tried using PNG but the files gets much larger. /Mathias