diff --git a/tools/fimgextract.c b/tools/fimgextract.c index 3cde1c65..2a530063 100644 --- a/tools/fimgextract.c +++ b/tools/fimgextract.c @@ -6,12 +6,14 @@ #include #include #include +#include #include "../floatimg.h" int verbosity; // nasty global var. /* --------------------------------------------------------------------- */ +/* nouveau - Mon Apr 8 11:52:18 UTC 2024 */ int copy_metadata(FloatImg *src, FloatImg *dst) { FimgMetaData *mdsrc, *mddst; @@ -21,7 +23,10 @@ fprintf(stderr, ">>> %s ( %p %p )\n", __func__, src, dst); #endif mdsrc = &(src->mdatas); mddst = &(dst->mdatas); -fprintf(stderr, "metadata copy: %p --> %p\n", mdsrc, mddst); +if (verbosity) fprintf(stderr, "%s: %p --> %p\n", __func__, mdsrc, mddst); + +mdsrc->reserved[1] = 0x55555555; +memcpy(mddst, mdsrc, sizeof(FimgMetaData)); return 0; } @@ -62,11 +67,12 @@ if (foo) { #endif return foo; } + /* XXX * may be we can also copy the metadate from src to dst ? * with an option on the command line ? */ -copy_metadata(&src, &dst); +foo = copy_metadata(&src, &dst); foo = fimg_dumpmd_to_file(&dst, dstname, NULL, 0); if (foo) { @@ -105,6 +111,7 @@ char *output_file = "out.fimg"; while ((opt = getopt(argc, argv, "ho:vx")) != -1) { switch(opt) { case 'h': help(); break; + case 'm': break; case 'o': output_file = optarg; break; case 'v': verbosity++; break; case 'x': experiment++; break; diff --git a/tools/fimgmetadata.c b/tools/fimgmetadata.c index 5e17dcf8..96452b61 100644 --- a/tools/fimgmetadata.c +++ b/tools/fimgmetadata.c @@ -16,7 +16,7 @@ int verbosity; enum comId { C_timestamp, C_daytime, C_count, C_fval, C_cpid, C_origin, - C_idcam, C_reserved, C_all }; + C_idcam, C_reserved, C_all, C_dayhour }; typedef struct { char *name; @@ -26,6 +26,7 @@ typedef struct { Cmd Cmd_list[] = { { "timestamp", C_timestamp }, { "daytime", C_daytime }, + { "dayhour", C_dayhour }, { "cpid", C_cpid }, { "count", C_count }, { "fval", C_fval }, @@ -86,6 +87,7 @@ int get_print_metadata(char *fname, char *command) { int foo, action; FimgMetaData metadata; +time_t tstamp; #if DEBUG_LEVEL fprintf(stderr, ">>> %s ( '%s' '%s' )\n", __func__, fname, command); @@ -98,11 +100,15 @@ if (foo) return foo; action = lookup_cmd(command); // fprintf(stderr, " command '%s' -> %d\n", command, action); +tstamp = metadata.timestamp.tv_sec; + switch(action) { case C_timestamp: - printf("timestamp %ld\n", metadata.timestamp.tv_sec); break; + printf("timestamp %ld\n", tstamp); break; case C_daytime: - printf("%s\n", ctime(&metadata.timestamp.tv_sec)); break; + printf("%s\n", ctime(&tstamp)); break; + case C_dayhour: + printf("%s\n", ctime(&tstamp)); break; case C_count: printf("count %d\n", metadata.count); break; case C_fval: