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

From: Juri Linkov <[email-masked]>
Date: Fri, 16 Dec 2011 01:32:38 +0200

> The patch below adds a new function `imagemagick_error' that is
> called in places where the ImageMagick returns `MagickFalse' status.

Patch installed.

> Removing `MagickSetResolution' cures this problem.  but I hesitate to
> remove it, because I don't know why it's here.  So at least moving
> `MagickSetResolution' a few lines below and calling after
> `MagickPingImage' will allow the read-only images to be correctly
> displayed:

Looking closer at the current situation, I discovered that
using `MagickSetResolution' is suggested by
http://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=16502
But this hack precludes from displaying some other image formats.
It is intended for loading multi-page djvu images.  Since the
functionality for browsing them is not implemented anyway, it can be
commented out until implemented in 24.2.

The relevant info from etc/TODO:

  *** For some reason its unbearably slow to look at a page in a large
  image bundle using the :index feature.  The ImageMagick "display"
  command is also a bit slow, but nowhere near as slow as the Emacs
  code.  It seems ImageMagick tries to unpack every page when loading the
  bundle.  This feature is not the primary usecase in Emacs though.

  ImageMagick 6.6.2-9 introduced a bugfix for single page djvu load.  It
  is now much faster to use the :index feature, but still not very fast.