emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image file name extension not recognized


From: Vinicius Jose Latorre
Subject: Re: Image file name extension not recognized
Date: Fri, 02 Feb 2007 23:49:22 -0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2pre) Gecko/20070111 SeaMonkey/1.1

Vinicius Jose Latorre wrote:
Chong Yidong wrote:
Vinicius Jose Latorre <address@hidden> 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.





reply via email to

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