GNU bug report logs - #10112
ImageMagick doesn't display some image formats

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Tue, 22 Nov 2011 22:09:02 UTC

Severity: normal

Tags: fixed, patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: ImageMagick doesn't display some image formats
Date: Wed, 23 Nov 2011 00:01:07 +0200
Visiting images whose format is supported by ImageMagick displays
a small empty box.

Read-only formats like .dot have only read-functions, but not write-functions
(the error being "no encode delegate for this image format").

`imagemagick_load_image' calls `MagickPingImage' to read image attributes.
But since before this calls there is an other call to `MagickSetResolution',
`MagickPingImage' assumes that we are going to modify the image, and returns
the `MagickFalse' status.

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:

=== modified file 'src/image.c'
--- src/image.c	2011-11-21 22:14:28 +0000
+++ src/image.c	2011-11-22 22:01:00 +0000
@@ -7618,7 +7618,6 @@ imagemagick_load_image
   image = image_spec_value (img->spec, QCindex, NULL);
   ino = INTEGERP (image) ? XFASTINT (image) : 0;
   ping_wand = NewMagickWand ();
-  MagickSetResolution (ping_wand, 2, 2);
   if (filename != NULL)
     {
       status = MagickPingImage (ping_wand, filename);
@@ -7628,6 +7627,8 @@ (at your option) any later version.
       status = MagickPingImageBlob (ping_wand, contents, size);
     }
 
+  MagickSetResolution (ping_wand, 2, 2);
+
   if (! (0 <= ino && ino < MagickGetNumberImages (ping_wand)))
     {
       image_error ("Invalid image number `%s' in image `%s'",





This bug report was last modified 9 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.