all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: thumbs-image-type?
Date: Sun, 23 Oct 2005 23:58:50 +0200	[thread overview]
Message-ID: <m3oe5f6gkl.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <7192.1129593214@olgas.newt.com> (Bill Wohler's message of "Mon, 17 Oct 2005 16:53:34 -0700")

Bill Wohler <wohler@newt.com> 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 <storm@cua.dk> http://www.cua.dk

      reply	other threads:[~2005-10-23 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17 23:53 thumbs-image-type? Bill Wohler
2005-10-23 21:58 ` Kim F. Storm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3oe5f6gkl.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.