XImagePtr ximg;
int x, y;
MagickWand *image_wand;
- MagickWand *ping_wand;
PixelIterator *iterator;
PixelWand **pixels, *bg_wand = NULL;
MagickPixelPacket pixel;
MagickWandGenesis ();
image = image_spec_value (img->spec, QCindex, NULL);
ino = INTEGERP (image) ? XFASTINT (image) : 0;
- ping_wand = NewMagickWand ();
- /* MagickSetResolution (ping_wand, 2, 2); (Bug#10112) */
+ image_wand = NewMagickWand ();
if (filename)
- status = MagickPingImage (ping_wand, filename);
+ status = MagickReadImage (image_wand, filename);
else
{
filename_hint = imagemagick_filename_hint (img->spec, hint_buffer);
- MagickSetFilename (ping_wand, filename_hint);
- status = MagickPingImageBlob (ping_wand, contents, size);
+ MagickSetFilename (image_wand, filename_hint);
+ status = MagickReadImageBlob (image_wand, contents, size);
}
if (status == MagickFalse)
{
- imagemagick_error (ping_wand);
- DestroyMagickWand (ping_wand);
+ imagemagick_error (image_wand);
+ DestroyMagickWand (image_wand);
return 0;
}
- if (ino < 0 || ino >= MagickGetNumberImages (ping_wand))
+ if (ino < 0 || ino >= MagickGetNumberImages (image_wand))
{
image_error ("Invalid image number `%s' in image `%s'",
image, img->spec);
- DestroyMagickWand (ping_wand);
+ DestroyMagickWand (image_wand);
return 0;
}
- if (MagickGetNumberImages (ping_wand) > 1)
+ if (MagickGetNumberImages (image_wand) > 1)
img->lisp_data =
Fcons (Qcount,
- Fcons (make_number (MagickGetNumberImages (ping_wand)),
+ Fcons (make_number (MagickGetNumberImages (image_wand)),
img->lisp_data));
- DestroyMagickWand (ping_wand);
-
- /* Now we know how many images are inside the file. If it's not a
- bundle, the number is one. Load the image data. */
-
- image_wand = NewMagickWand ();
-
- if (filename)
- status = MagickReadImage (image_wand, filename);
- else
- {
- MagickSetFilename (image_wand, filename_hint);
- status = MagickReadImageBlob (image_wand, contents, size);
- }
-
- if (status == MagickFalse)
- {
- imagemagick_error (image_wand);
- goto imagemagick_error;
- }
-
/* If we have an animated image, get the new wand based on the
"super-wand". */
if (MagickGetNumberImages (image_wand) > 1)