From: Rekhesh Mohan Date: Thu, 8 Nov 2012 08:10:53 +0000 (+0530) Subject: Merge branch 'testing' now v2.1 X-Git-Url: https://cads.iiap.res.in/gitview/?a=commitdiff_plain;h=HEAD;p=fits2jpeg.git Merge branch 'testing' now v2.1 Conflicts: ChangeLog.txt configure.ac src/filesys.c src/fits2jpeg.c src/image.c --- ca5520b0c818f4ad57e2e57d557fc999f9dfe3c7 diff --cc src/filesys.c index e7ff547,873f891..8e40c52 --- a/src/filesys.c +++ b/src/filesys.c @@@ -23,11 -23,8 +23,10 @@@ /*Header Definitions*/ #include "fits2jpeg.h" - /*---------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------------------* + * MAKE_DIR: Wrapper to mkdir() with some basic error checks + *---------------------------------------------------------------------------*/ int make_dir(char * folder, mode_t mode) { struct stat st; diff --cc src/image.c index a47b9b7,7f7a8e8..819158b --- a/src/image.c +++ b/src/image.c @@@ -82,6 -79,9 +82,9 @@@ void scale_pixels(int scale, unsigned i /* the dynamic range is reduced to 255 for jpeg */ scl_data = (datamax - datamin)/(float)JMAXVAL; + /* we will end up with segfaults if scl_data = 0 */ - if (scl_data = 0) scl_data = 1; ++ if (scl_data == 0) scl_data = 1; + for (i = 0; i < npixels; ++i) data[i] = (data[i] - datamin)/scl_data;