bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Juri Linkov
Subject: bug#10112: ImageMagick doesn't display some image formats
Date: Wed, 23 Nov 2011 00:01:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (x86_64-pc-linux-gnu)

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'",






reply via email to

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