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