diff --git a/ccdfunc.c b/ccdfunc.c index 6012968..34925ee 100644 --- a/ccdfunc.c +++ b/ccdfunc.c @@ -211,13 +211,14 @@ int saveFITS(IMG *img, char **outp){ } int width = img->w, height = img->h; void *data = (void*) img->data; - long naxes[2] = {width, height}, tmpl; + long naxes[2] = {width, height}; double tmpd = 0.0; float tmpf = 0.0; int tmpi = 0; struct tm *tm_time; char bufc[FLEN_CARD]; time_t savetime = time(NULL); + double dsavetime = dtime(); fitsfile *fp; fitserror = 0; TRYFITS(fits_create_file, &fp, fnam); @@ -277,10 +278,9 @@ int saveFITS(IMG *img, char **outp){ // DATE / Creation date (YYYY-MM-DDThh:mm:ss, UTC) strftime(bufc, FLEN_VALUE, "%Y-%m-%dT%H:%M:%S", gmtime(&savetime)); WRITEKEY(fp, TSTRING, "DATE", bufc, "Creation date (YYYY-MM-DDThh:mm:ss, UTC)"); - tmpl = (long) savetime; tm_time = localtime(&savetime); strftime(bufc, FLEN_VALUE, "File creation time (UNIX)", tm_time); - WRITEKEY(fp, TLONG, "UNIXTIME", &tmpl, bufc); + WRITEKEY(fp, TDOUBLE, "UNIXTIME", &dsavetime, bufc); strftime(bufc, 80, "%Y/%m/%d", tm_time); // DATE-OBS / DATE (YYYY/MM/DD) OF OBS. WRITEKEY(fp, TSTRING, "DATE-OBS", bufc, "DATE OF OBS. (YYYY/MM/DD, local)"); diff --git a/locale/ru/messages.po b/locale/ru/messages.po index 9f045fb..107b7cf 100644 --- a/locale/ru/messages.po +++ b/locale/ru/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-20 11:45+0300\n" +"POT-Creation-Date: 2023-04-02 12:50+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/ru/ru.po b/locale/ru/ru.po index ae497b1..8a825e7 100644 --- a/locale/ru/ru.po +++ b/locale/ru/ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" - "POT-Creation-Date: 2023-03-09 11:35+0300\n" + "POT-Creation-Date: 2023-04-02 12:50+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/server.c b/server.c index 852c0a5..0fbb1ca 100644 --- a/server.c +++ b/server.c @@ -516,7 +516,7 @@ static hresult formathandler(int fd, const char *key, const char *val){ char buf[64]; frameformat fmt; if(val){ - if(strcmp(key, CMD_FRAMEMAX)) return RESULT_BADKEY; // can't set maxformat + if(0 == strcmp(key, CMD_FRAMEMAX)) return RESULT_BADKEY; // can't set maxformat if(4 != sscanf(val, "%d,%d,%d,%d", &fmt.xoff, &fmt.yoff, &fmt.w, &fmt.h)) return RESULT_BADVAL; fmt.w -= fmt.xoff; fmt.h -= fmt.yoff; int r = camera->setgeometry(&fmt); diff --git a/server.h b/server.h index 4efefd3..c6e176f 100644 --- a/server.h +++ b/server.h @@ -40,8 +40,8 @@ char *makeabspath(const char *path, int shouldbe); // get last exposed image #define CMD_GETIMAGE "getimage" // get image size in pixels -#define CMD_IMWIDTH "imheight" -#define CMD_IMHEIGHT "imwidth" +#define CMD_IMWIDTH "imwidth" +#define CMD_IMHEIGHT "imheight" // CCD/CMOS #define CMD_CAMLIST "camlist"