author | Rekhesh Mohan <reks@iiap.res.in> | |
Thu, 8 Nov 2012 08:10:53 +0000 (13:40 +0530) | ||
committer | Rekhesh Mohan <reks@iiap.res.in> | |
Thu, 8 Nov 2012 08:10:53 +0000 (13:40 +0530) |
Conflicts:
ChangeLog.txt
configure.ac
src/filesys.c
src/fits2jpeg.c
src/image.c
ChangeLog.txt
configure.ac
src/filesys.c
src/fits2jpeg.c
src/image.c
1 | 2 | |||
---|---|---|---|---|
ChangeLog.txt | patch | | diff1 | | diff2 | | blob | history |
src/filesys.c | patch | | diff1 | | diff2 | | blob | history |
src/image.c | patch | | diff1 | | diff2 | | blob | history |
diff --combined ChangeLog.txt
--- 1/ChangeLog.txt
--- 2/ChangeLog.txt
+++ b/ChangeLog.txt
version fits2jpeg-1.0
------------------------------------------------------------------------
+ 2.1 Release
+ -----------
+ 1. Fixed a segfault on blank/zero images
- Updates in 2.0 Release
- ----------------------
+
+ 2.0 Release
+ -----------
1. Merged scale & operations to single flag
v1.0 had normalize/equalize handled by "-e" flag and rest of
A negative image can be generated using "-n" flag.
4. New option to resize image
- zoom or shrink output image using "-z <zoomfact>".
+ zoom or shrink output image by "-z <zoomfact>".
5. New option to choose jpeg quality factor
- You can choose the jpeg quality factor using "-q <quality>"
+ You can choose the jpeg quality factor by "-q <quality>"
Quality factor was fixed at 100 in previous release.
+ 6. New option to specify output directory for saving jpeg images
+ Output location can be specified by "-d </path/to/folder>"
+ If the target directory does not exist, the whole tree will be
+ created.
diff --combined src/filesys.c
--- 1/src/filesys.c
--- 2/src/filesys.c
+++ b/src/filesys.c
/*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;
return status;
}
+/*---------------------------------------------------------------------------*
+ * MAKE_TREE: moves through a directory path and creates directories and
+ * subdirectories using make_dir(), top-down.
+ *---------------------------------------------------------------------------*/
int make_tree(char * folder, mode_t mode)
{
char *pp;
return status;
}
+/*---------------------------------------------------------------------------*
+ * STRDUP: This one is not a part of ANSI-strict, so we had to write one
+ *---------------------------------------------------------------------------*/
char *strdup(const char *str)
{
int n = strlen(str) + 1;
diff --combined src/image.c
--- 1/src/image.c
--- 2/src/image.c
+++ b/src/image.c
/*Header Definitions*/
#include "fits2jpeg.h"
+/*---------------------------------------------------------------------------*
+ * READ_FITS: To reads data from a fits image file.. (isn't that obvious?)
+ *---------------------------------------------------------------------------*/
void read_fits(char * fits_file_name, long * xdim, long * ydim, float ** data)
{
fitsfile *fptr;
/* 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;