Змінні
Darktable підтримує заміщення змінних у ряді модулів та налаштуваннях. Наприклад:
-
Визначення імен файлів у модулі Експорт
-
Відображення інформації про зображення в Темній кімнаті в рядку з інформацією про зображення
-
Відображення інформації про зображення в накладках та підказках в режимі Світлого стола (див. Налаштування > Світлий стіл)
-
Розміщення тексту на зображенні в модулі обробки Водяний знак
🔗Доступні змінні
Доступні такі змінні, хоча не всі вони можуть бути застосовні в кожному контексті:
$(ROLL.NAME) film roll of the input image
$(FILE.FOLDER) folder containing the input image
$(FILE.NAME) basename of the input image
$(FILE.EXTENSION) extension of the input image
$(ID) the image id
$(VERSION) the duplicate version number
$(VERSION.IF_MULTI) same as $(VERSION) but null string if only one version exists
$(VERSION.NAME) version name from metadata
$(DARKTABLE.VERSION) the version of the running darktable instance
$(DARKTABLE.NAME) name of darktable
$(SEQUENCE[n,m]) a sequence number within an export job with n digits and starting with m
parameters are optional, default is [4,1]
$(WIDTH.SENSOR) width of RAW data in pixels before RAW crop
$(HEIGHT.SENSOR) height of RAW data in pixels before RAW crop
$(WIDTH.RAW) width of RAW data in pixels after RAW crop
$(HEIGHT.RAW) height of RAW data in pixels after RAW crop
$(WIDTH.CROP) image width in pixels at the end of the pixelpipe, but before export resize
$(HEIGHT.CROP) image height in pixels at the end of the pixelpipe, but before export resize
$(WIDTH.EXPORT) image width in pixels at the end of the pixelpipe and after export resize
$(HEIGHT.EXPORT) image height in pixels at the end of the pixelpipe and after export resize
$(WIDTH.MAX) maximum width entered in export module
$(HEIGHT.MAX) maximum height entered in export module
$(YEAR) year at date of import/export
$(YEAR.SHORT) two-digit year at date of import/export
$(MONTH) numeric (1-12) month at date of import/export
$(MONTH.LONG) full month name at date of import/export
$(MONTH.SHORT) abbreviated month name at date of import/export
$(DAY) day at date of import/export
$(HOUR) hour at time of import/export
$(MINUTE) minute at time of import/export
$(SECOND) second at time of import/export
$(MSEC) millisecond at time of import/export
$(EXIF.YEAR) Exif year
$(EXIF.YEAR.SHORT) Exif year, two-digit version
$(EXIF.MONTH) Exif month, numeric
$(EXIF.MONTH.LONG) Exif month, full name
$(EXIF.MONTH.SHORT) Exif month, abbreviated name
$(EXIF.DAY) Exif day
$(EXIF.HOUR) Exif hour
$(EXIF.MINUTE) Exif minute
$(EXIF.SECOND) Exif second
$(EXIF.MSEC) Exif millisecond
$(EXIF.DATE.REGIONAL) Exif date using user's preferred regional date format
$(EXIF.TIME.REGIONAL) Exif time using user's preferred regional date format
$(EXIF.ISO) Exif ISO value
$(EXIF.EXPOSURE) Exif exposure
$(EXIF.EXPOSURE.BIAS) Exif exposure bias
$(EXIF.EXPOSURE.PROGRAM) Exif exposure program set in camera
$(EXIF.APERTURE) Exif aperture
$(EXIF.CROP_FACTOR) Exif crop factor
$(EXIF.FLASH) Exif flash setting
$(EXIF.FLASH.ICON) flash symbol if Exif information says flash was fired, empty string if not
$(EXIF.FOCAL.LENGTH) Exif focal length
$(EXIF.FOCAL.LENGTH.EQUIV) Exif 35 mm equivalent focal length
$(EXIF.FOCUS.DISTANCE) Exif focus distance
$(EXIF.LENS) Exif lens name
$(EXIF.MAKER) Exif camera maker
$(EXIF.METERING) Exif metering mode
$(EXIF.MODEL) Exif camera model
$(EXIF.WHITEBALANCE) Exif white balance set in camera
$(IMAGE.EXIF) basic exposure information from Exif data (aperture, exposure, ISO)
$(IMAGE.ID) the image id (note that this will be 0 during copy&import)
$(IMAGE.ID[n]) the image id (note that this will be 0 during copy&import), zero-padded to n digits
$(IMAGE.ID.NEXT) the next image id to be assigned (can be used during copy&import)
$(IMAGE.ID.NEXT[n]) the next image id to be assigned (can be used during copy&import), zero-padded to n digits
$(IMAGE.TAGS) tags list (Xmp.dc.Subject), with any hierarchy flattened
$(IMAGE.TAGS.HIERARCHY) tags list (Xmp.dc.Subject), preserving hierarchy
$(LONGITUDE) longitude
$(LATITUDE) latitude
$(ELEVATION) elevation
$(GPS.ELEVATION) elevation
$(GPS.LATITUDE) latitude
$(GPS.LONGITUDE) longitude
$(GPS.LOCATION) latitude, longitude, and elevation (omitting any values which are not set)
$(GPS.LOCATION.ICON) symbol to indicate that geolocation information is present, empty string if not
$(STARS) star rating (text only)
$(RATING.ICONS) star rating (using star characters)
$(LABELS) colorlabels (color labels as text)
$(LABELS.ICONS) colorlabels (color labels as icons)
$(MAKER) camera maker
$(MODEL) camera model
$(LENS) lens
$(TITLE) title from metadata
$(DESCRIPTION) description from metadata
$(CREATOR) creator from metadata
$(PUBLISHER) publisher from metadata
$(RIGHTS) rights from metadata
$(TAGS) tags list (Xmp.dc.Subject)
$(CATEGORY[n,category]) tag name of level n [0,9] of selected category (or tag)
$(SIDECAR_TXT) content of the text sidecar file (if any)
$(FOLDER.PICTURES) pictures folder
$(FOLDER.HOME) home folder
$(FOLDER.DESKTOP) desktop folder
$(OPENCL.ACTIVATED) whether OpenCL is activated
$(USERNAME) user name defined by OS
$(NL) newline character
$(JOBCODE) internal jobcode of current job
🔗Метадані
Fields from the metadata editor can be used for variable substitution using the last part of the associated tag name as the variable name. For example, the xmp tag Xmp.iptc.location
is available as the variable $(LOCATION)
.
🔗Підстановка рядків
Всі змінні підтримують базову заміну рядків, натхненну bash (командним процесором Unix-подібних систем), хоча деякі деталі відрізняються.
Усі шаблони розглядаються як прості порівняння рядків. Підтримка регулярних виразів відсутня.
Надаються такі функції заміни рядків, де var
є однією із перелічених вище змінних:
$(var-default) Якщо var порожня, поверніть "default"
Можна використовувати іншу змінну як "default", напр.
$(WIDTH.CROP-$(WIDTH.RAW))
$(var+alt_value) Якщо var встановлено, повернути "alt_value", інакше повернути порожній рядок
$(var:offset) Повернути var, починаючи зі зміщення offset
Якщо зміщення від'ємне, відлік йде від кінця рядка
$(var:offset:length) Починаючи зі зміщення offset, повернути як максимум length символів var
Якщо зміщення від’ємне, довжина відлічується від кінця змінної var
Якщо довжина від’ємна, це означає кінець результату,
відлічується від кінця var, а не фактичної довжини
$(var#pattern) Видалити "pattern" з початку var
$(var%pattern) Видалити "pattern" з кінця var
$(var/pattern/replacement) Замінити перше входження "pattern" у var на "replacement"
Якщо "replacement" є порожнім, тоді "pattern" буде видалено
$(var//pattern/replacement) Замінити всі входження "pattern" у var на "replacement"
Якщо "replacement" є порожнім, тоді "pattern" буде видалено
$(var/#pattern/replacement) Якщо var починається з "pattern", тоді "pattern" замінюється на "replacement"
$(var/%pattern/replacement) Якщо var закінчується на "pattern", тоді "pattern" замінюється на "replacement"
$(var^) Перевести перший символ var у верхній регістр
$(var^^) Перевести всі символи var у верхній регістр
$(var,) Перевести перший символ var у нижній регістр
$(var,,) Перевести всі символи var у нижній регістр
🔗Форматування
Шаблони інформації про зображення підтримують розмітку. Наприклад, додавання наступного надасть чітке попередження (великий, червоний, жирний текст), коли OpenCL не вдалося ініціалізувати:
<span alpha='1%'>$(OPENCL_ACTIVATED/no/<span foreground='red' weight='heavy' size='xx-large' alpha='100%'>OPENCL ACTIVATION FAILED</span>$(NL))</span>