From 5d7d5b88adad6cd3ccf5cb8a0f550b1422aea3a0 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 10 Dec 2016 08:36:01 -0500 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31028 --- ChangeLog | 2 ++ coders/fits.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c080a0cf..7fe28cfc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31016). * Return correct offset for negative index for -fx option (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31019). + * Fixed improper scaling of certain FITS images (reference + https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31028). 2016-12-05 7.0.3-9 Cristy * Release ImageMagick version 7.0.3-9, GIT revision 19139:6fed3f1:20161205. diff --git a/coders/fits.c b/coders/fits.c index 24e71f57c..d414fe3d4 100644 --- a/coders/fits.c +++ b/coders/fits.c @@ -435,7 +435,8 @@ static Image *ReadFITSImage(const ImageInfo *image_info, (void) SetImageColorspace(image,GRAYColorspace,exception); if ((fits_info.min_data == 0.0) && (fits_info.max_data == 0.0)) { - if (fits_info.zero == 0.0) + if ((fits_info.bits_per_pixel == -32) || + (fits_info.bits_per_pixel == -64)) (void) GetFITSPixelExtrema(image,fits_info.bits_per_pixel, &fits_info.min_data,&fits_info.max_data); else -- 2.40.0