[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: thumbs-image-type?
From: |
Kim F. Storm |
Subject: |
Re: thumbs-image-type? |
Date: |
Sun, 23 Oct 2005 23:58:50 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Bill Wohler <address@hidden> writes:
> It seems to me that the following should be renamed to image-type and
> moved to image.el, or--probably better--calls to thumbs-image-type
> should be replaced by image-type-from-file-header.
>
> (defun thumbs-image-type (img)
> "Return image type from filename IMG."
> (cond ((string-match ".*\\.jpe?g\\'" img) 'jpeg)
> ((string-match ".*\\.xpm\\'" img) 'xpm)
> ((string-match ".*\\.xbm\\'" img) 'xbm)
> ((string-match ".*\\.gif\\'" img) 'gif)
> ((string-match ".*\\.bmp\\'" img) 'bmp)
> ((string-match ".*\\.png\\'" img) 'png)
> ((string-match ".*\\.tiff?\\'" img) 'tiff)))
I have added image-type-from-file-name to image.el.
I also added image-type-from-buffer inspired by the function
mm-image-type-from-buffer in mm-decode.el, and used it to
simplify image-file-from-file-header.
--
Kim F. Storm <address@hidden> http://www.cua.dk