get introspection in lua
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the linked Darktable-xmp script and the base64.lua file mentioned in the TODO list. Clarify the intended introspection interface and how existing Lua XML libraries should read and write params. Done would require an agreed scope plus working compressed-value handling and automatic parameter read/write.
Written by the indexing model from the issue text.
Description
hello,
I was willing to write a lua script that changes some values (like exposure) in a bunch of pictures, I didn't found any.
I thougth to start writing a "tool" to do this, it is far from ready but i think it is a good starting point if someone would like to collaborate
I never used lua before so you may find some weird syntax, you can find the code here
https://repl.it/@VincenzoG/Darktable-xmp
example code:
require "tools/xmp_utility"
input = "0000000010c7babce0ce773e00004842000080c0"
exposure_params = {mode = 1, black = 2, exposure = 3, deflicker_percentile = 4, deflicker_target_level = 5}
exposure_table = dt_xmp_decode(input)
print(table.concat(exposure_table, " "))
print("Mode:", exposure_table[exposure_params.mode])
print("black:", exposure_table[exposure_params.black])
print("exposure:", exposure_table[exposure_params.exposure])
print("deflicker_percentile:", exposure_table[exposure_params.deflicker_percentile])
print("deflicker_target_level:", exposure_table[exposure_params.deflicker_target_level])
print(dt_xmp_encode(exposure_table))
exposure_table[exposure_params.exposure] = exposure_table[exposure_params.exposure] - 0.02
print("new exposure:", exposure_table[exposure_params.exposure])
print(dt_xmp_encode(exposure_table))
and it's output:
0 -0.022799998521805 0.24200010299683 50 -4
Mode: 0
black: -0.022799998521805
exposure: 0.24200010299683
deflicker_percentile: 50
deflicker_target_level: -4
0000000010c7babce0ce773e00004842000080c0
new exposure: 0.22200010299683
0000000010c7babcfe53633e00004842000080c0
todo list:
- use compressed values: i found on google some part of code but i didn't integrated them, yet, you could find them in the
base64.luafile - automatically read/write the
params: this can be done knowing the file path and using one of the already existing xml library for lua
If someone would like to collaborate tell me!
- Dominant language
- Lua
- Stars
- 219
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from darktable-org/lua-scripts
-
dtutils.string: build_substitute_list errors when a metadata field (e.g. rights) has been removed Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
darktable-org/lua-scripts#716 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
darktable-org/lua-scripts#706 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
darktable-org/lua-scripts#627 · 2 comments ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
darktable-org/lua-scripts#618 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
darktable-org/lua-scripts#710 · 3 comments ·
All issues in darktable-org/lua-scripts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
fluent/fluent-bit-docs#2727 ·
-
OS:Windows
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
api7/lua-resty-saml#62 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100