Add ExposureTime tag

This commit is contained in:
simon987 2020-06-21 16:50:36 -04:00
parent 59fd5252a5
commit 00d5680217

View File

@ -9,7 +9,6 @@
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include <fcntl.h>
__always_inline __always_inline
@ -95,6 +94,10 @@ void parse_raw(scan_raw_ctx_t *ctx, vfile_t *f, document_t *doc) {
snprintf(tmp, sizeof(tmp), "%.1f", libraw_lib->other.aperture); snprintf(tmp, sizeof(tmp), "%.1f", libraw_lib->other.aperture);
APPEND_STR_META(doc, MetaExifFNumber, tmp) APPEND_STR_META(doc, MetaExifFNumber, tmp)
int denominator = (int)roundf(1 / libraw_lib->other.shutter);
snprintf(tmp, sizeof(tmp), "1/%d", denominator);
APPEND_STR_META(doc, MetaExifExposureTime, tmp)
APPEND_STR_META(doc, MetaMediaVideoCodec, "raw") APPEND_STR_META(doc, MetaMediaVideoCodec, "raw")
if (ctx->tn_size <= 0) { if (ctx->tn_size <= 0) {