From 37118bc2f1a25f3805d6e7be203b3265790d7200 Mon Sep 17 00:00:00 2001 From: Ricardo Zanmar Date: Mon, 27 Jun 2011 18:35:47 +0200 Subject: [PATCH] Yet another bug fix on zscalemax I was wrongly adding zscalemin to the calculation of zscalemax. I had to add datamin instead which is independent of the histogram. --- loader_fits.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader_fits.c b/loader_fits.c index ce925f5..b614aa0 100644 --- a/loader_fits.c +++ b/loader_fits.c @@ -173,7 +173,7 @@ load(ImlibImage * im, ImlibProgressFunction progress, nmax = bin[ k ]; mostfreq = k; } - //fprintf(stderr, "%ld ", bin[ k ] ); + fprintf(stderr, "%ld ", bin[ k ] ); } fprintf(stderr, "\nmostfreq and nmax = %d %ld ", mostfreq, nmax ); @@ -209,7 +209,7 @@ load(ImlibImage * im, ImlibProgressFunction progress, if( sumpix > ndataok ) break; } - zscalemax = ( ( k + 1 ) + 0.5 ) * binw + zscalemin; + zscalemax = ( ( k + 1 ) + 0.5 ) * binw + datamin; } //free( bin ); @@ -217,8 +217,8 @@ load(ImlibImage * im, ImlibProgressFunction progress, // use the new zscale min/max values to rescale and create imlib im ptr += w * h - 1; fpixel = 1; - color = 1; - inv = 0; + color = 0; + inv = 1; for (y = 0; y < h; y++) { fits_read_img( f, TDOUBLE, fpixel, nbuffer, &nullval, -- 2.32.0.93.g670b81a890