Skip to content

Commit 62e9329

Browse files
authored
Merge pull request #583 from wpferguson/fix_image_time_issue_582
Fix image time exiftime generation with blank fields
2 parents 0043769 + 980fe39 commit 62e9329

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/image_time.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ local function systime2exiftime(systime)
154154
end
155155

156156
local function vars2exiftime(year, month, day, hour, min, sec)
157-
local y = tonumber(year) and string.format("%4d", year) or " "
158-
local mo = tonumber(month) and string.format("%02d", month) or " "
159-
local d = tonumber(day) and string.format("%02d", day) or " "
160-
local h = tonumber(hour) and string.format("%02d", hour) or " "
161-
local m = tonumber(min) and string.format("%02d", min) or " "
162-
local s = tonumber(sec) and string.format("%02d", sec) or " "
157+
local y = tonumber(year) and string.format("%4d", year) or "0000"
158+
local mo = tonumber(month) and string.format("%02d", month) or "00"
159+
local d = tonumber(day) and string.format("%02d", day) or "00"
160+
local h = tonumber(hour) and string.format("%02d", hour) or "00"
161+
local m = tonumber(min) and string.format("%02d", min) or "00"
162+
local s = tonumber(sec) and string.format("%02d", sec) or "00"
163163
return(y .. ":" .. mo .. ":" .. d .. " " .. h .. ":" .. m .. ":" .. s)
164164
end
165165

0 commit comments

Comments
 (0)