Subject: Re: bug#9045: 24.0.50; Cannot display image: (Invalid image type `jpeg')

From: Glenn Morris <[email-masked]>
Date: Tue, 12 Jul 2011 17:50:34 -0400

Peter Dyballa wrote:

> I have configured GNU Emacs without direct JPEG and TIFF support.
> After launching it with -Q I execute in *scratch* buffer
>
> 	(imagemagick-register-types)
>
> (nil is returned). When I view from dired file.jpeg, then only its
> bytes are displayed in a (Fundamental Image View) buffer. In
> *Messages* buffer
>
> 	Cannot display image: (Invalid image type `jpeg')

This happens because in the function `image-type',
image-type-from-file-header returns `jpeg', and image-types has no entry
for jpeg.

image-type-from-file-name on the other hand, returns `imagemagick', and
image-types does have an entry for this.

Simply swapping the order of the tests in image-type doesn't seem like
the right fix though.