From d8bb6f4ec6b76660f7ae16b8a1be523aae4df187 Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 24 Jul 2020 16:21:24 +0200 Subject: [PATCH] this is really a WTF bug --- funcs/fimg-fits.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/funcs/fimg-fits.c b/funcs/fimg-fits.c index 542d9d70..aa8d7549 100644 --- a/funcs/fimg-fits.c +++ b/funcs/fimg-fits.c @@ -36,17 +36,21 @@ if (fits_create_file(&fptr, outname, &status)) { } naxes[0] = src->width; naxes[1] = src->height; - array = calloc(src->height, sizeof(float *)); +if (verbosity) fimg_describe(src, "to be saved as FITS"); -if (verbosity) fimg_describe(src, "to be saved as fits"); - +#define REVERSE 1 /* initialize pointers to the start of each row of the image */ +array[0] = src->R; for( idx=0; idxR + (k*naxes[0]); - fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); + fprintf(stderr, " %6d %6d %p\n", idx, k, array[idx]); } if ( fits_create_img(fptr, bitpix, naxis, naxes, &status) ) {