more fun with metadata

This commit is contained in:
tth
2022-04-17 04:25:31 +02:00
parent 263e254980
commit 4dcc524fc4
3 changed files with 19 additions and 5 deletions

View File

@@ -32,8 +32,10 @@ int fimg_show_metadata(FimgMetaData *pmd, char *title, int notused)
int foo;
double doubletime;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p '%s' 0x%08x )\n", __func__,
pmd, title, notused);
#endif
if (verbosity) {
fprintf(stderr, "sizeof(metadata) = %ld\n", \
@@ -78,7 +80,10 @@ if (foo) {
perror("omg");
}
else {
fprintf(stderr, "Time of day %12ld %12ld\n", tvl.tv_sec, tvl.tv_usec);
if (verbosity) {
fprintf(stderr, "Time of day %12ld %12ld\n", \
tvl.tv_sec, tvl.tv_usec);
}
memcpy(&(pmd->timestamp), &tvl, sizeof(struct timeval));
}
@@ -86,7 +91,7 @@ pmd->cpid = getpid();
pmd->count = 0;
pmd->fval = 255.0;
strcpy(pmd->idcam, "<unknow>");
pmd->origin = 0x55555555;
pmd->origin = 0xdeadbeef;
return 0;
}
@@ -98,9 +103,9 @@ FimgFileHead filehead;
FimgMetaData metadata;
int foo;
// #if DEBUG_LEVEL
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %p )\n", __func__, fname, pmd);
// #endif
#endif
if (NULL==(fp=fopen(fname, "r"))) {
perror(fname);

View File

@@ -28,6 +28,9 @@ foo = fimg_default_metadata(&Md);
foo = fimg_get_metadata_from_file(fname, &Md);
fprintf(stderr, "%s : get metadata -> %d\n", fname, foo);
if (foo) {
return foo;
}
foo = fimg_show_metadata(&Md, fname, 0);