[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using libmagic in Emacs?
From: |
Richard Stallman |
Subject: |
Re: using libmagic in Emacs? |
Date: |
Sun, 23 Aug 2009 20:07:18 -0400 |
The problem is that `image-jpeg-p' in image.el refuses to accept
non-JFIF JPEG image files whereas Emacs can correctly display them
when tests in `image-jpeg-p' are ignored.
Using libmagic means looking only for 2 bytes 0xffd8 (a magic number
of JPEG files) as described by the magic number file:
0 beshort 0xffd8 JPEG image data
It seems this is enough to determine JPEG files. But I'm not confident
about removing additional tests from `image-jpeg-p'. We could keep the
current rules in image.el as a fall-back when libmagic is not available.
Whatever we do with the function `image-jpeg-p', we could easily make
Emacs test these two bytes. It makes no sense to install code to link
with libmagic just to handle that and a few other similar things.
Meanwhile, for operations less common and important than visiting a file,
running `file' is easy to do.
Combining those two approaches seems much better than adding code to
link with libmagic.
- Re: Bidi support, (continued)
- Re: Bidi support, Jason Rumney, 2009/08/22
- Bidi support, Stephen J. Turnbull, 2009/08/22
- Re: Bidi support, Eli Zaretskii, 2009/08/22
- Re: Bidi support, Kenichi Handa, 2009/08/23
- Re: Bidi support, Eli Zaretskii, 2009/08/23
- Re: Bidi support, Kenichi Handa, 2009/08/24
- Re: Bidi support, Stephen J. Turnbull, 2009/08/23
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/18
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/19
- Re: using libmagic in Emacs?, Juri Linkov, 2009/08/22
- Re: using libmagic in Emacs?,
Richard Stallman <=
- Re: using libmagic in Emacs?, Juri Linkov, 2009/08/23
- Re: using libmagic in Emacs?, joakim, 2009/08/24
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/24
- Re: using libmagic in Emacs?, Miles Bader, 2009/08/24
- Re: using libmagic in Emacs?, joakim, 2009/08/25
- Re: using libmagic in Emacs?, James Cloos, 2009/08/25
- Re: using libmagic in Emacs?, Thien-Thi Nguyen, 2009/08/25
Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/25
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/25
Re: using libmagic in Emacs?, Juri Linkov, 2009/08/29