unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10112: ImageMagick doesn't display some image formats
@ 2011-11-22 22:01 Juri Linkov
  2011-11-24 19:09 ` Juri Linkov
  0 siblings, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2011-11-22 22:01 UTC (permalink / raw)
  To: 10112

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






^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-12-09  1:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 22:01 bug#10112: ImageMagick doesn't display some image formats Juri Linkov
2011-11-24 19:09 ` Juri Linkov
2011-11-24 21:42   ` Wolfgang Jenkner
2011-11-24 21:52     ` Wolfgang Jenkner
2011-11-24 22:49       ` Juri Linkov
2011-12-15 23:57         ` Juri Linkov
2012-06-13 23:57           ` Juri Linkov
2014-12-08 23:32           ` Lars Magne Ingebrigtsen
2014-12-09  0:58             ` Juri Linkov
2014-12-09  1:18               ` Lars Magne Ingebrigtsen
2011-12-15 23:32   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).