unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Jose Latorre <viniciusjl@ig.com.br>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Re: Image file name extension not recognized
Date: Fri, 02 Feb 2007 23:49:22 -0200	[thread overview]
Message-ID: <45C3EA22.4050200@ig.com.br> (raw)
In-Reply-To: <45C3E888.2090302@ig.com.br>

Vinicius Jose Latorre wrote:
> Chong Yidong wrote:
>> Vinicius Jose Latorre <viniciusjl@ig.com.br> writes:
>>
>>  
>>> I have some image files with names like:
>>>
>>>    IMG_0366.JPG
>>>
>>> When I try to open it, Emacs does not recognize it as an image file.
>>>
>>> But if I rename the file to:
>>>
>>>    IMG_0366.jpg
>>>
>>> Then Emacs recognizes the file as an image file.
>>>
>>> Shouldn't Emacs recognize files with .JPG extension as an image file?
>>>     
>>
>> Jpeg images are supposed to be autodetected using their contents, even
>> if the file extension is JPG (see image-type-header-regexps).
>> Apparently, that autodetection is failing in this case.  Could you try
>> to find out why?
>
> The image-type-header-regexps variable has the value:
>
>  '(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
>    ("\\`P[1-6]" . pbm)
>    ("\\`GIF8" . gif)
>    ("\\`\211PNG\r\n" . png)
>    ("\\`[\t\n\r ]*#define" . xbm)
>    ("\\`\\(MM\0\\*\\|II\\*\0\\)" . tiff)
>    ("\\`[\t\n\r ]*%!PS" . postscript)
>    ("\\`\xff\xd8" . (image-jpeg-p . jpeg)))
>
> Where image-jpeg-p is a function.
>
> I just type  M-x debug-on-entry RET image-jpeg-p RET
>
> Then tried to open the file again and image-jpeg-p is not called.

Hummm, very interesting, if I rename the extension file to .jpg 
extension, then image-jpeg-p is called.

  parent reply	other threads:[~2007-02-03  1:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03  0:49 Image file name extension not recognized Vinicius Jose Latorre
2007-02-03  1:03 ` Chong Yidong
2007-02-03  1:42   ` Vinicius Jose Latorre
2007-02-03  1:46     ` Chong Yidong
2007-02-03  2:14       ` Vinicius Jose Latorre
2007-02-03  2:35         ` Vinicius Jose Latorre
2007-02-03  2:36           ` Juanma Barranquero
2007-02-03  1:49     ` Vinicius Jose Latorre [this message]
2007-02-03  1:06 ` Juanma Barranquero
2007-02-03  1:18   ` Vinicius Jose Latorre
2007-02-03  1:43     ` Chong Yidong
2007-02-03  1:51       ` Vinicius Jose Latorre
2007-02-03  1:59         ` Juanma Barranquero

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=45C3EA22.4050200@ig.com.br \
    --to=viniciusjl@ig.com.br \
    --cc=cyd@stupidchicken.com \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).