From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: Fri, 27 May 2005 17:45:05 +0300 Organization: JURTA Message-ID: <87hdgon2p2.fsf@jurta.org> References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.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 1117205899 16486 80.91.229.2 (27 May 2005 14:58:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 May 2005 14:58:19 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 27 16:58:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbgG1-0002br-UD for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 16:56:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbgKJ-0007Ez-FD for ged-emacs-devel@m.gmane.org; Fri, 27 May 2005 11:00:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbgJ0-0006cJ-Ts for emacs-devel@gnu.org; Fri, 27 May 2005 10:59:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbgIx-0006ai-6j for emacs-devel@gnu.org; Fri, 27 May 2005 10:59:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbgIw-0006a6-SB for emacs-devel@gnu.org; Fri, 27 May 2005 10:59:18 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbgFf-0005De-D2 for emacs-devel@gnu.org; Fri, 27 May 2005 10:55:55 -0400 Original-Received: from mail.neti.ee (80-235-33-24-dsl.mus.estpak.ee [80.235.33.24]) by Relayhost1.neti.ee (Postfix) with ESMTP id C05522F39; Fri, 27 May 2005 17:54:57 +0300 (EEST) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Thu, 26 May 2005 16:19:51 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:37777 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37777 > Much, much easier to just use md5(). Even though I like when thumbnail file names are composed from file name parts (this allows to purge old thumbnails based on their names), this method is not reliable, because thumbnails don't get updated when image file contents changes. AFAIK, GIMP uses md5 for naming thumbnail files. It stores original file names as comments in image files. thumb.el could do the same adding comments with original file names, e.g.: /usr/bin/convert -comment "Description: Thumbnail of /home/user/images/image.jpg" -sample 100x100 "/home/user/images/image.jpg" "png:/home/user/.emacs-thumbs/b765f25b9ed0233aaefcd601e63d6c86.png" BTW, in thumbs.el the condition for comparing geometry is currently commented out: ;; This is not the right fix, but I don't understand ;; the external program or why it produces a geometry ;; unequal to the one requested -- rms. ;;; (not (equal (thumbs-file-size tn) thumbs-geometry)) The reason why the conversion program produces a different geometry is because it tries to maintain the aspect ratio of the original image. One solution is to add the geometry string to thumbnail file names, e.g. /home/user/.emacs-thumbs/100x100_b765f25b9ed0233aaefcd601e63d6c86.png or to add the original geometry string to the thumbnail file comments: /usr/bin/convert -comment "Geometry: 100x100" ... with assumption that it is possible to extract comments in Emacs from image files before comparing them with the current value of thumbs-geometry. -- Juri Linkov http://www.jurta.org/emacs/