variáveis

O darktable suporta a substituição de variáveis em diversos módulos e configurações de preferências. Por exemplo:

🔗variáveis disponíveis

As seguintes variáveis estão disponíveis, ainda que nem todas sejam aplicáveis em todos os contextos:

$(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)                a sequence number within an export job
$(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.APERTURE)           Exif aperture
$(EXIF.CROP_FACTOR)        Exif crop factor
$(EXIF.FOCAL.LENGTH)       Exif focal length
$(EXIF.FOCAL.LENGTH.EQUIV) Exif 35 mm equivalent focal length
$(EXIF.FOCUS.DISTANCE)     Exif focus distance
$(IMAGE.EXIF)              basic exposure information from Exif data (aperture, exposure, ISO)
$(LONGITUDE)               longitude
$(LATITUDE)                latitude
$(ELEVATION)               elevation
$(GPS.LOCATION)            latitude, longitude, and elevation (omitting any values which are not set)
$(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)
$(CATEGORYn(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

🔗substituição de texto

Todas as variáveis suportam a substituição de texto básica inspirada pelo bash, ainda que alguns detalhes sejam diferentes.

Todos os padrões são tratados como simples comparações de cadeias de texto. Não há nenhum suporte a expressões regulares.

As seguintes funções de substituição de texto são fornecidas, onde var é uma das variáveis listadas acima:

$(var-default)			Se var está vazio, devolve "default"
				É possível usar outra variável como "default", por exemplo
				$(WIDTH.CROP-$(WIDTH.RAW))

$(var+alt_value)		Se var foi fixada, devolve "alt_value" caso contrário, devolve cadeia vazia

$(var:offset)			Devolve o valor de var começando pelo caractere de número "offset"
				Se offset é negativo, conta a partir do final da cadeia de caracteres

$(var:offset:comprimento)	A partir da posição de "offset", devolve o máximo de "comprimento" de caracteres de var
				Se offset é negativo o comprimento se conta a partir do final de var
				Se comprimento é negativo, isto indica o final do resultado,
				contando a partir do final de var, e não o comprimento real

$(var#padronagem)		Elimina "padronagem" do início de var

$(var%padronagem)		Elimina "padronagem" do final de var

$(var/padronagem/substituicao)	Sustitui a primeira ocorrência de "padronagem" em var com "substituicao"
				Se "substituicao" está vazio, "padronagem" é eliminado

$(var//padronagem/substituicao)	Sustitui todas as ocorrências de "padronagem" em var com "substituicao"
				Se "substituicao" está vazio, "padronagem" é eliminado

$(var/#padronagem/substituicao)	Se var começa por "padronagem" então "padronagem" é substituído com "substituicao"

$(var/%padronagem/substituicao)	Se var termina com "padronagem" então "padronagem" é substituído com "substituicao"

$(var^)				Converte o primeiro caractere de var em maiúscula

$(var^^)			Converte todos os caracteres de var em maiúsculas

$(var,)				Converte o primeiro caractere de var em minúscula

$(var,,)			Converte todos os caracteres de var em minúsculas

🔗formatação

Os padrões de informações da imagem suportam marcação. Por exemplo, adicionar o seguinte fornecerá um aviso claro (texto grande, vermelho e em negrito) quando o OpenCL falhar ao inicializar:

<span alpha='1%'>$(OPENCL_ACTIVATED/no/<span foreground='red' weight='heavy' size='xx-large' alpha='100%'>ATIVAÇÂO DO OPENCL FALHOU</span>$(NL))</span>

translations