emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few issues with thumbs.el


From: Juri Linkov
Subject: Re: A few issues with thumbs.el
Date: Fri, 27 May 2005 17:45:05 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> 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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]