|
@@ -156,28 +156,28 @@ local function isempty(s)
|
|
|
return s == nil or s == ''
|
|
return s == nil or s == ''
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
----------------------------------------------------------------
|
|
|
|
|
--- helper functions to access darktable feature via user interface
|
|
|
|
|
--- use event handling helper functions to wait for pixel pipe
|
|
|
|
|
--- processing to complete
|
|
|
|
|
-
|
|
|
|
|
-local function numberToString(number, nilReplacement, nanReplacement)
|
|
|
|
|
- -- convert given number to string
|
|
|
|
|
- -- return 'not a number' and 'nil' as '0/0'
|
|
|
|
|
- -- log output equals to dt.gui.action command and parameters
|
|
|
|
|
- if (number ~= number) then
|
|
|
|
|
- return nanReplacement or '0/0'
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- if (number == nil) then
|
|
|
|
|
- return nilReplacement or '0/0'
|
|
|
|
|
|
|
+local function remove_unneeded_exif_values ( jpeg_file )
|
|
|
|
|
+ local tags_to_remove = {
|
|
|
|
|
+ "ModifyDate", "DateTimeOriginal", "CreateDate", "DateCreated",
|
|
|
|
|
+ "TimeCreated", "GPSTimeStamp", "GPSDateStamp", "GPSDateTime",
|
|
|
|
|
+ "IFD0:*", "IFD1:*"
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ local args = {"-overwrite_original"}
|
|
|
|
|
+ for _, tag in ipairs(tags_to_remove) do
|
|
|
|
|
+ table.insert(args, "-" .. tag .. "=")
|
|
|
end
|
|
end
|
|
|
-
|
|
|
|
|
- -- some digits with dot
|
|
|
|
|
- local result = string.format('%.4f', number)
|
|
|
|
|
- result = string.gsub(result, ',', '.')
|
|
|
|
|
-
|
|
|
|
|
- return result
|
|
|
|
|
|
|
+ table.insert(args, "-FileModifyDate<FileModifyDate")
|
|
|
|
|
+ table.insert(args, filename)
|
|
|
|
|
+
|
|
|
|
|
+ --run_exiftool( jpeg_file .. " " .. table.concat(args, " ") )
|
|
|
|
|
+ local exiftoolbinary = get_executable("exiftoolbinary", "exiftool")
|
|
|
|
|
+ run_cmd = exiftoolbinary..' '..jpeg_file..' '.. table.concat(args, " ")
|
|
|
|
|
+ LogInfo(string.format("Running %s", run_cmd))
|
|
|
|
|
+ local job = dt.gui.create_job(string.format("Running %s", run_cmd), true, stop_job)
|
|
|
|
|
+ resp = dtsys.external_command(run_cmd)
|
|
|
|
|
+ job.valid = false
|
|
|
|
|
+ return nil
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-- Function to replace German umlauts and sanitize the filename
|
|
-- Function to replace German umlauts and sanitize the filename
|
|
@@ -242,6 +242,7 @@ local publication_button = dt.new_widget("button")
|
|
|
run_exiftool( df.sanitize_filename(i.path..PS..i.filename), tmp_exported, '-exif:all --subifd:all --Orientation -overwrite_original' )
|
|
run_exiftool( df.sanitize_filename(i.path..PS..i.filename), tmp_exported, '-exif:all --subifd:all --Orientation -overwrite_original' )
|
|
|
-- copy exif data from xmp file
|
|
-- copy exif data from xmp file
|
|
|
run_exiftool( df.sanitize_filename(i.sidecar) , tmp_exported, '-xmp:all -exif:all --subifd:all -overwrite_original' )
|
|
run_exiftool( df.sanitize_filename(i.sidecar) , tmp_exported, '-xmp:all -exif:all --subifd:all -overwrite_original' )
|
|
|
|
|
+ remove_unneeded_exif_values(tmp_exported)
|
|
|
-- run mailscript
|
|
-- run mailscript
|
|
|
local spring2lifescript = get_executable("spring2lifescript", "spring2life script")
|
|
local spring2lifescript = get_executable("spring2lifescript", "spring2life script")
|
|
|
run_cmd = spring2lifescript .. " " .. tmp_exported
|
|
run_cmd = spring2lifescript .. " " .. tmp_exported
|