[Top][All Lists]

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

Re: Image mode

From: Stefan Monnier
Subject: Re: Image mode
Date: Mon, 05 Feb 2007 13:56:45 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

> As Richard has argued, IF displaying an image can cause a security
> risk, it doesn't matter whether or not that image was autodetected or
> had the relevant file name.  So let's please not worry about this.

Agreed.  Security in this case is a secondary concern.
So let's not forget the other main problems we're trying to solve:
1 - misdetection of foo.JPG as a non-image.
2 - misdetection of non-images because of the content of unrelated files.
3 - misdetection of thumb-images in special directories.

The first (which started this whole thing) is trivially solved by setting
the stupid variable `auto-mode-case-fold' to t.  The var was only introduced
to allow Richard to default its value to nil because of some undisclosed

The second is the one that justifies to not auto-display image.  It's been
somewhat solved by tightening the image-detection code, but it can't be made
100% reliable.  Note that I know of no other application which uses such
content-detection to discover whether a file is an image or something else.
All other applications I know either use the file-extension or some
out-of-band metadata (e.g. the mime-type provided by the web-server, usually
itself derived from the file-extension).  Of course, some applications use
the file content to decide *which* image format it's dealing with, but this
is a different problem than the one facing Emacs.

The third could be easily addressed in auto-mode-alist by matching the
directory name rather than the file extension.


reply via email to

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