2. types

This section documents types that are specific to darktable's Lua API.

2.1. types.dt_lua_image_t

dt_type

Image objects represent an image in the database. This is slightly different from a file on disk since a file can have multiple developements. Note that this is the real image object; changing the value of a field will immediately change it in darktable and will be reflected on any copy of that image object you may have kept.

 Attributes: has_tostring

2.1.9. types.dt_lua_image_t.id

number

A unique id identifying the image in the database.

2.1.10. types.dt_lua_image_t.path

string

The file the directory containing the image.

2.1.11. types.dt_lua_image_t.film

types.dt_lua_film_t

The film object that contains this image.

2.1.12. types.dt_lua_image_t.filename

string

The filename of the image.

2.1.13. types.dt_lua_image_t.sidecar

string

The filename of the image's sidecar file.

2.1.14. types.dt_lua_image_t.duplicate_index

number

If there are multiple images based on a same file, each will have a unique number, starting from 0.

2.1.15. types.dt_lua_image_t.publisher

string

The publisher field of the image.

 Attributes: write

2.1.16. types.dt_lua_image_t.title

string

The title field of the image.

 Attributes: write

2.1.17. types.dt_lua_image_t.creator

string

The creator field of the image.

 Attributes: write

2.1.18. types.dt_lua_image_t.rights

string

The rights field of the image.

 Attributes: write

2.1.19. types.dt_lua_image_t.description

string

The description field for the image.

 Attributes: write

2.1.20. types.dt_lua_image_t.exif_maker

string

The maker exif data.

 Attributes: write

2.1.21. types.dt_lua_image_t.exif_model

string

The camera model used.

 Attributes: write

2.1.22. types.dt_lua_image_t.exif_lens

string

The id string of the lens used.

 Attributes: write

2.1.23. types.dt_lua_image_t.exif_aperture

number

The aperture saved in the exif data.

 Attributes: write

2.1.24. types.dt_lua_image_t.exif_exposure

number

The exposure time of the image.

 Attributes: write

2.1.25. types.dt_lua_image_t.exif_focal_length

number

The focal length of the image.

 Attributes: write

2.1.26. types.dt_lua_image_t.exif_iso

number

The iso used on the image.

 Attributes: write

2.1.27. types.dt_lua_image_t.exif_datetime_taken

string

The date and time of the image.

 Attributes: write

2.1.28. types.dt_lua_image_t.exif_focus_distance

number

The distance of the subject.

 Attributes: write

2.1.29. types.dt_lua_image_t.exif_crop

number

The exif crop data.

 Attributes: write

2.1.30. types.dt_lua_image_t.latitude

float or nil

GPS latitude data of the image, nil if not set.

 Attributes: write

2.1.31. types.dt_lua_image_t.longitude

float or nil

GPS longitude data of the image, nil if not set.

 Attributes: write

2.1.32. types.dt_lua_image_t.elevation

float or nil

GPS altitude data of the image, nil if not set.

 Attributes: write

2.1.33. types.dt_lua_image_t.is_raw

boolean

True if the image is a RAW file.

2.1.34. types.dt_lua_image_t.is_ldr

boolean

True if the image is a ldr image.

2.1.35. types.dt_lua_image_t.is_hdr

boolean

True if the image is a hdr image.

2.1.36. types.dt_lua_image_t.has_txt

boolean

True if the image has a txt sidecar file.

 Attributes: write

2.1.37. types.dt_lua_image_t.width

number

The width of the image.

2.1.38. types.dt_lua_image_t.height

number

The height of the image.

2.1.39. types.dt_lua_image_t.rating

number

The rating of the image (-1 for rejected).

 Attributes: write

2.1.40. types.dt_lua_image_t.red

boolean

True if the image has the corresponding colorlabel.

 Attributes: write

2.1.45. types.dt_lua_image_t.reset

self:function(
)

Removes all processing from the image, reseting it back to its original state

self
types.dt_lua_image_t

The image whose history will be deleted

2.1.46. types.dt_lua_image_t.delete

self:function(
)

Removes an image from the database

self
types.dt_lua_image_t

The image to remove

2.1.47. types.dt_lua_image_t.group_with

self:function(
[image : types.dt_lua_image_t]
)

Puts the first image in the same group as the second image. If no second image is provided the image will be in its own group.

self
types.dt_lua_image_t

The image whose group must be changed.

[image]
types.dt_lua_image_t

The image we want to group with.

self:function(
)

Makes the image the leader of its group.

self
types.dt_lua_image_t

The image we want as the leader.

2.1.49. types.dt_lua_image_t.get_group_members

self:function(
) : table of types.dt_lua_image_t

Returns a table containing all types.dt_lua_image_t of the group. The group leader is both at a numeric key and at the "leader" special key (so you probably want to use ipairs to iterate through that table).

self
types.dt_lua_image_t

The image whose group we are querying.

return
table of types.dt_lua_image_t

A table of image objects containing all images that are in the same group as the image.

types.dt_lua_image_t

The image which is the leader of the group this image is a member of.

2.1.51. types.dt_lua_image_t.local_copy

boolean

True if the image has a copy in the local cache

 Attributes: write

2.1.52. types.dt_lua_image_t.drop_cache

self:function(
)

drops the cached version of this image.

This function should be called if an image is modified out of darktable to force DT to regenerate the thumbnail

darktable will regenerate the thumbnail by itself when it is needed

self
types.dt_lua_image_t

The image whose cache must be droped.