Subject: bug#10112: ImageMagick doesn't display some image formats

From: Juri Linkov <[email-masked]>
Date: Thu, 14 Jun 2012 02:57:05 +0300

I'm starting to adapt this patch to the recent changes in bug#11557.

I propose the following modifications:

1. Currently the priority of specialized image libraries over
ImageMagick is hard-coded in `imagemagick-register-types' as:

	  ;; Append to `image-type-file-name-regexps', so that we
	  ;; preferentially use specialized image libraries.
	  (add-to-list 'image-type-file-name-regexps
	  	       (cons re 'imagemagick) t)

It could use a new customizable variable where the user can specify
whether to use ImageMagick for all enabled image types, or use
available specialized libraries.  The same option could also specify the
priority of `imagemagick' elements in `image-type-header-regexps'.

Or maybe this new option is not necessary, and `imagemagick'
should have the highest priority.  When the user wants to use
specialized image libraries, it's possible to remove conflicting
image types (such as jpeg/png/gif) from `imagemagick-enabled-types'.

2. The most user-friendly UI to enable image types
is to allow the user to select a set of enabled formats
from the list of all available formats displayed as checkboxes.
This is like during installation of some graphical programs
when they present a list of available image format to allow the user
to associate them with file extensions.

It's possible to do this in Customization UI using the following type
for `imagemagick-enabled-types':

  :type (cons 'set (mapcar
		    (lambda (type)
		      (list 'const type))
		    (sort (imagemagick-types) 'string<)))

3. `imagemagick-types-inhibit' could use the same customization type,
and it should be renamed to `imagemagick-disabled-types' or completely
removed, with adding a new element to `imagemagick-enabled-types'
that will specify whether the list excludes/includes the defined types.