fix wrong month in EXIF.MONTH.LONG and EXIF_MONTH.SHORT when no exif date available in image#653
Conversation
|
The default for string substitution is that we return an empty string if we can't come up with a substitution.
Set them to |
ok, will do that. My thinking was kind of the opposite: If they are used, e.g. as a folder name, a blank variable would disturb the pattern, hierarchy, etc. |
I think so. It helped above when I said that about the default so now I can look at this with that in mind. When I was fixing it, I didn't think about the big picture. |
|
Changes done as you requested. |
|
You can set it from a script local ds = require "lib/dtutils.string
local log = require "lib/dtutils.log
ds.log_level = log.warnOr, we could keep it hidden in the library and add getter and setter functions in the library to manipulate the log level |
Would be nice if there was an option one could specify when starting darktable, like |
Shouldn't be. It comes from the image, not the operating system.
I already have in mind a script that lets you change the log level of another script on the fly, so if something isn't behaving and you're already running with Starting |
And there is darktable core in between. If I understand the coding correctly, the value is set to an empty string, if no tag is found: |
Yes. That's consistent across platforms. In practice you almost never run into it, so it's mostly a corner case. The substitution code went a long time before anyone managed to find the bug. My solution wasn't very well thought out. |
|
@deekayhd Everything looks good to me, are we good to merge? |
|
@wpferguson From my perspective, we can merge! |
PR #594 fixed a bug in rename_images.lua with images that have no EXIF datetime. However, the fix (setting datetime_taken to 0000.00.00) does not work on Windows, because the date is smaller than what can be represented on this platform.
In addition, on linux the date 0000.00.00 results in EXIF.MONTH.LONG and EXIF.MONTH.SHORT as "November" and "Nov", respectively.
In this PR I propose to skip the calculation of EXIF.MONTH.LONG and .SHORT for images without a date, and set them as follows:
EXIF.MONTH.LONG = "unknown"
EXIF.MONTH.SHORT = "???"
closes issue #627