help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: View image types


From: Peter Dyballa
Subject: Re: View image types
Date: Mon, 6 Mar 2006 12:17:45 +0100


Am 06.03.2006 um 05:32 schrieb Eli Zaretskii:


When I press v on an XPM, XBM, or PS file I don't see the picture,
only the file's internal code. For PNG, GIF, TIFF, JPEG, or PBM
formats I see the picture and no code at all.

Did you turn on the auto-image-file-mode?  If not, what you see is
expected behavior.


That's it! Thank you!

image-file-name-extensions is the variable that names all the file types by file name extension to display them. PostScript does not belong to this list, and when added I still see only the PS code. I'll investigate this some other day ...

One item close to a bug exists: valid JPEG2000 files are not displayed! Neither when I add jp2 to image-file-name-extensions nor when I hard link a JP2 file to a JPG file, I only get:

        create-image: Cannot determine image type

It looks as if image-type-header-regexps, whose default value seems to be

  '(("\\`/[\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)))

needs to be extended with a representation of this magic entry:

0 string \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A JPEG 2000 image data

The JP2 buffer starts with

        ^@^@^@^LjP  ^M^J\207^J

so an expression like

        ("\\`\0\0\0\14jP  " . (image-jpeg-p . jpeg))

might already do the job ...

--
Greetings

  Pete

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.






reply via email to

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