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: A few issues with thumbs.el Date: Wed, 25 May 2005 17:18:33 +0200 Message-ID: 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 1117034996 16345 80.91.229.2 (25 May 2005 15:29:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 May 2005 15:29:56 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 25 17:29:47 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Daxnz-0002fv-W6 for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 17:28:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Daxrs-0000CV-OW for ged-emacs-devel@m.gmane.org; Wed, 25 May 2005 11:32:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DaxnV-0007Cv-7t for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DaxnO-00077b-50 for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DaxnM-00073H-Nv for emacs-devel@gnu.org; Wed, 25 May 2005 11:27:44 -0400 Original-Received: from [64.233.184.207] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Daxev-0005Ub-8J for emacs-devel@gnu.org; Wed, 25 May 2005 11:19:01 -0400 Original-Received: by wproxy.gmail.com with SMTP id 50so220392wri for ; Wed, 25 May 2005 08:18:34 -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:mime-version:content-type:content-transfer-encoding:content-disposition; b=dxxb3CCAtIEsOT7JiIrzBJDIoNVHzBOgt5alonZUcW9JeZyQwl14Aw0o8QwlZrbAF9/v1G0f7J95q/vRVdQWGk363hKYRR8xGLUgqBA3XJu3gdk6gAnyxpdjbAFiWFhfThQH/IXkZHh9L+BWCh2WGeNjH7j/9AdaOziE8EWw09U= Original-Received: by 10.54.117.4 with SMTP id p4mr396153wrc; Wed, 25 May 2005 08:18:33 -0700 (PDT) Original-Received: by 10.54.82.6 with HTTP; Wed, 25 May 2005 08:18:33 -0700 (PDT) Original-To: emacs-devel@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:37617 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37617 I've been testing thumbs.el on Windows, and I have a few issues: - Thumbs functions by default create jpeg thumbnails, but they don't check whether the jpeg image support is loaded; that fails in dynamic-loading environments. That is addressed in the patch below. - `thumbs-thumbname' makes a simple transformation on the image filename to generate a thumbnail filename (taking out slashes and changing spaces to underscores). That simple transformation fails on Windows (it doesn't modify the ":" in drive:path, for example). I could fix that, but instead of playing cat&mouse with unusual chars, I think it'd be better to just make a digest of the name (with md5) and get rid of the problem. That's addressed in the patch below, too. - When using `thumb', there's a crash on MSVC builds only; it happens on jpeg_memory_src. I think the problem is unrelated to the other day's troubles. I'll take a look at debugging it. Unaddressed. - The docstring of `thumbs-gensym' is wrong with respect to its argument. But, instead of fixing the docstring, wouldn't be just better to get rid of the argument? I mean, thumbs.el uses the function without passing it, and I don't think there's much use outside of thumbs.el for a `gensym'-alike that doesn't really add that much to `gensym'. Or is there? - Other than being interactive, does `thumbs-kill-buffer' something different that (quit-window t (selected-window)) ? /L/e/k/t/u Index: lisp/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.7592 diff -u -2 -r1.7592 ChangeLog --- lisp/ChangeLog=0925 May 2005 14:18:45 -0000=091.7592 +++ lisp/ChangeLog=0925 May 2005 14:54:53 -0000 @@ -14,4 +14,8 @@ =09(thumbs-increment-image-size, thumbs-decrement-image-size): =09Fix typos in docstrings. +=09(thumbs-thumbname): Use `md5' to safely encode all kinds of +=09filenames. +=09(thumbs-show-thumbs-list): Check for availability of the 'jpeg +=09image type. =20 2005-05-24 Andre Spiegel Index: lisp/thumbs.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/thumbs.el,v retrieving revision 1.11 diff -u -2 -r1.11 thumbs.el --- lisp/thumbs.el=0925 May 2005 14:08:33 -0000=091.11 +++ lisp/thumbs.el=0925 May 2005 14:24:14 -0000 @@ -303,11 +303,5 @@ (defun thumbs-thumbname (img) "Return a thumbnail name for the image IMG." - (concat thumbs-thumbsdir "/" -=09 (subst-char-in-string -=09 ?\ ?\_ -=09 (apply -=09 'concat -=09 (split-string -=09 (expand-file-name img) "/"))))) + (concat thumbs-thumbsdir "/" (md5 (expand-file-name img)))) =20 (defun thumbs-make-thumb (img) @@ -379,6 +373,7 @@ =20 (defun thumbs-show-thumbs-list (L &optional buffer-name same-window) - (when (not (display-images-p)) - (error "Images are not supported in this Emacs session")) + (unless (and (display-images-p) + (image-type-available-p 'jpeg)) + (error "Required image type is not supported in this Emacs session")) (funcall (if same-window 'switch-to-buffer 'pop-to-buffer) =09 (or buffer-name "*THUMB-View*"))