unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A few issues with thumbs.el
@ 2005-05-25 15:18 Juanma Barranquero
  2005-05-25 22:24 ` Stefan Monnier
  2005-05-26  0:48 ` Juanma Barranquero
  0 siblings, 2 replies; 70+ messages in thread
From: Juanma Barranquero @ 2005-05-25 15:18 UTC (permalink / raw)


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
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.7592
diff -u -2 -r1.7592 ChangeLog
--- lisp/ChangeLog	25 May 2005 14:18:45 -0000	1.7592
+++ lisp/ChangeLog	25 May 2005 14:54:53 -0000
@@ -14,4 +14,8 @@
 	(thumbs-increment-image-size, thumbs-decrement-image-size):
  	Fix typos in docstrings.
+	(thumbs-thumbname): Use `md5' to safely encode all kinds of
+	filenames.
+	(thumbs-show-thumbs-list): Check for availability of the 'jpeg
+	image type.
 
  2005-05-24  Andre Spiegel  <spiegel@gnu.org>
Index: lisp/thumbs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/thumbs.el,v
retrieving revision 1.11
diff -u -2 -r1.11 thumbs.el
--- lisp/thumbs.el	25 May 2005 14:08:33 -0000	1.11
+++ lisp/thumbs.el	25 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 "/"
-	  (subst-char-in-string
-	   ?\  ?\_
-	   (apply
-	    'concat
-	    (split-string
-	     (expand-file-name img) "/")))))
+  (concat thumbs-thumbsdir "/" (md5 (expand-file-name img))))
 
  (defun thumbs-make-thumb (img)
@@ -379,6 +373,7 @@
 
  (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)
 	   (or buffer-name "*THUMB-View*"))

^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2005-06-14 12:53 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-25 15:18 A few issues with thumbs.el Juanma Barranquero
2005-05-25 22:24 ` Stefan Monnier
2005-05-26  0:40   ` Juanma Barranquero
2005-05-26  3:01     ` Stefan Monnier
2005-05-26  8:17       ` Juanma Barranquero
2005-05-26 14:03         ` Stefan Monnier
2005-05-26  9:37     ` Juanma Barranquero
2005-05-26 14:02       ` Stefan Monnier
2005-05-26 14:19         ` Juanma Barranquero
2005-05-26 16:55           ` Stefan Monnier
2005-05-26 18:22             ` Juanma Barranquero
2005-05-26 19:24               ` Stefan Monnier
2005-05-26 22:49                 ` Juanma Barranquero
2005-05-26 23:05                   ` Stefan Monnier
2005-05-27  7:45                     ` Juanma Barranquero
2005-05-27 14:19                     ` Richard Stallman
2005-05-27 14:45           ` Juri Linkov
2005-05-28 11:53             ` Richard Stallman
2005-05-28 18:00               ` Juanma Barranquero
2005-05-28 21:03                 ` Robert J. Chassell
2005-05-29  2:48                   ` Juanma Barranquero
2005-05-29 20:27                     ` Robert J. Chassell
2005-05-29 21:48                       ` Juanma Barranquero
2005-05-30  0:42                         ` Robert J. Chassell
2005-05-29 12:04                 ` Richard Stallman
2005-05-29 15:08                   ` Juanma Barranquero
2005-05-30 10:03             ` Juanma Barranquero
2005-05-30 18:57               ` Juri Linkov
2005-05-30 20:29                 ` Juanma Barranquero
2005-05-30 20:38                   ` David Kastrup
2005-05-30 21:05               ` Stefan Monnier
2005-05-30 21:20                 ` Juanma Barranquero
2005-05-31 17:46                 ` Richard Stallman
2005-05-31 23:20                   ` Juanma Barranquero
2005-06-09  2:00                 ` Juanma Barranquero
2005-06-09 13:22                   ` Stefan Monnier
2005-06-09 13:35                     ` Juanma Barranquero
2005-06-09 14:22                       ` Stefan Monnier
2005-06-09 14:44                         ` Juanma Barranquero
2005-06-09 15:56                           ` Stefan Monnier
2005-06-12  9:13                       ` Mathias Dahl
2005-06-12 23:40                         ` Juanma Barranquero
2005-06-12 10:45                     ` Mathias Dahl
2005-06-12 23:46                       ` Juanma Barranquero
2005-06-13  7:12                         ` Mathias Dahl
2005-06-13  7:28                           ` Juanma Barranquero
2005-06-10  0:14                   ` Richard Stallman
2005-06-10  0:38                     ` Juanma Barranquero
2005-06-10 12:37                       ` Mathias Dahl
2005-06-10 14:27                         ` Juanma Barranquero
2005-06-10 15:06                           ` Juanma Barranquero
2005-06-12  9:01                 ` Mathias Dahl
2005-06-12 10:30                   ` Henrik Enberg
2005-06-12 14:02                     ` Mathias Dahl
2005-06-12 15:33                       ` Paul Pogonyshev
2005-06-13  6:02                       ` Juri Linkov
2005-06-13  7:11                         ` Mathias Dahl
2005-06-13  7:28                         ` Mathias Dahl
2005-06-13 21:48                           ` Daniel Brockman
2005-06-14 12:53                           ` Mathias Dahl
2005-06-13  8:44                       ` Kim F. Storm
2005-06-13 14:21                         ` Mathias Dahl
2005-06-13 22:03                           ` Daniel Brockman
2005-06-13 15:03                       ` Richard Stallman
2005-06-13 16:56                         ` Paul Pogonyshev
2005-06-13 23:38                           ` Richard Stallman
2005-06-12 18:03                   ` Stefan Monnier
2005-06-13  6:01                     ` Juri Linkov
2005-06-13 15:02                     ` Richard Stallman
2005-05-26  0:48 ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).