From 2bbd71a3277501cea7c101f3686f8b18f3dc1c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= Date: Sat, 13 Dec 2014 10:55:58 +0100 Subject: [PATCH] official/generate_image_text : rework header --- official/generate_image_txt.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/official/generate_image_txt.lua b/official/generate_image_txt.lua index 85cdee9..1f0efed 100644 --- a/official/generate_image_txt.lua +++ b/official/generate_image_txt.lua @@ -14,21 +14,29 @@ You should have received a copy of the GNU General Public License along with darktable. If not, see . +]] +--[[ +GENERATE IMAGE TEXT +A script to run a command on images to generate text metadata + +The medata will be displayed as an overlay on the image in lighttable mode + +USAGE +* require this script from your main lua file +* set a command to run on all image, this command should output text on stdout +* enable image file generation + + ]] -- TODO: -- * enable showing of the txt file (plugins/lighttable/draw_custom_metadata) if this script is enabled +-- * maybe allow a lua command returning text instead of a command line call ? both ? -- * make filenames with double quotes (") work local dt = require "darktable" require "darktable.debug" - --- version check to make sure that we have the new callback to register to -local min_api_version = "2.1.0-dev" -if dt.configuration.api_version_string < min_api_version then - dt.print_error("[generate_image_txt] lua api too old, at least "..min_api_version.." is required, but "..dt.configuration.api_version_string.." was found") - return -end +dt.configuration.check_version(...,{2,1,0}) dt.preferences.register("generate_image_txt", "enabled",