diff --git a/Magick++/tests/readWriteImages.cpp b/Magick++/tests/readWriteImages.cpp index 005722251c..c3405882f5 100644 --- a/Magick++/tests/readWriteImages.cpp +++ b/Magick++/tests/readWriteImages.cpp @@ -123,12 +123,12 @@ int main(int,char ** argv) third.write("testmagick_anim_out.ico"); fourth.read("testmagick_anim_out.ico"); - if (fourth.magick() != "ICO") + if (fourth.magick() != "BMP") { ++failures; cout << "Line: " << __LINE__ << " Image magick: " << fourth.magick() - << " is not equal to ICO" + << " is not equal to BMP" << endl; } diff --git a/magick/image.c b/magick/image.c index d62095f8d4..cf9357769b 100644 --- a/magick/image.c +++ b/magick/image.c @@ -2827,7 +2827,8 @@ MagickExport MagickBooleanType SetImageInfo(ImageInfo *image_info, } } *extension='\0'; - GetPathComponent(image_info->filename,ExtensionPath,extension); + if (*image_info->magick == '\0') + GetPathComponent(image_info->filename,ExtensionPath,extension); if (*extension != '\0') { char