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: Mathias Dahl
Subject: Re: A few issues with thumbs.el
Date: 12 Jun 2005 11:01:18 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Stefan Monnier <address@hidden> 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





reply via email to

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