From 980fe3962c64592c3b5a8d3385b8c04065fa2262 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Thu, 1 May 2025 20:37:24 -0400 Subject: [PATCH] image_time - added default values of 0 for fields not supplied in set time so that an exiftime can be created.\ --- contrib/image_time.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/image_time.lua b/contrib/image_time.lua index 28570c1..c097130 100644 --- a/contrib/image_time.lua +++ b/contrib/image_time.lua @@ -154,12 +154,12 @@ local function systime2exiftime(systime) end local function vars2exiftime(year, month, day, hour, min, sec) - local y = tonumber(year) and string.format("%4d", year) or " " - local mo = tonumber(month) and string.format("%02d", month) or " " - local d = tonumber(day) and string.format("%02d", day) or " " - local h = tonumber(hour) and string.format("%02d", hour) or " " - local m = tonumber(min) and string.format("%02d", min) or " " - local s = tonumber(sec) and string.format("%02d", sec) or " " + local y = tonumber(year) and string.format("%4d", year) or "0000" + local mo = tonumber(month) and string.format("%02d", month) or "00" + local d = tonumber(day) and string.format("%02d", day) or "00" + local h = tonumber(hour) and string.format("%02d", hour) or "00" + local m = tonumber(min) and string.format("%02d", min) or "00" + local s = tonumber(sec) and string.format("%02d", sec) or "00" return(y .. ":" .. mo .. ":" .. d .. " " .. h .. ":" .. m .. ":" .. s) end