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:

2.1.1. types.dt_lua_image_t.attach_tag

see darktable.tags.attach

2.1.2. types.dt_lua_image_t.detach_tag

see darktable.tags.detach

2.1.3. types.dt_lua_image_t.get_tags

see darktable.tags.get_tags

2.1.4. types.dt_lua_image_t.create_style

see darktable.styles.create

2.1.5. types.dt_lua_image_t.apply_style

see darktable.styles.apply

2.1.6. types.dt_lua_image_t.duplicate

see darktable.database.duplicate

2.1.7. types.dt_lua_image_t.move

see darktable.database.move_image

2.1.8. types.dt_lua_image_t.copy

see darktable.database.copy_image

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:

2.1.16. types.dt_lua_image_t.title

string

The title field of the image.

Attributes:

2.1.17. types.dt_lua_image_t.creator

string

The creator field of the image.

Attributes:

2.1.18. types.dt_lua_image_t.rights

string

The rights field of the image.

Attributes:

2.1.19. types.dt_lua_image_t.description

string

The description field for the image.

Attributes:

2.1.20. types.dt_lua_image_t.exif_maker

string

The maker exif data.

Attributes:

2.1.21. types.dt_lua_image_t.exif_model

string

The camera model used.

Attributes:

2.1.22. types.dt_lua_image_t.exif_lens

string

The id string of the lens used.

Attributes:

2.1.23. types.dt_lua_image_t.exif_aperture

number

The aperture saved in the exif data.

Attributes:

2.1.24. types.dt_lua_image_t.exif_exposure

number

The exposure time of the image.

Attributes:

2.1.25. types.dt_lua_image_t.exif_focal_length

number

The focal length of the image.

Attributes:

2.1.26. types.dt_lua_image_t.exif_iso

number

The iso used on the image.

Attributes:

2.1.27. types.dt_lua_image_t.exif_datetime_taken

string

The date and time of the image.

Attributes:

2.1.28. types.dt_lua_image_t.exif_focus_distance

number

The distance of the subject.

Attributes:

2.1.29. types.dt_lua_image_t.exif_crop

number

The exif crop data.

Attributes:

2.1.30. types.dt_lua_image_t.latitude

float or nil

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

Attributes:

2.1.31. types.dt_lua_image_t.longitude

float or nil

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

Attributes:

2.1.32. types.dt_lua_image_t.elevation

float or nil

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

Attributes:

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:

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:

2.1.40. types.dt_lua_image_t.red

boolean

True if the image has the corresponding colorlabel.

Attributes:

2.1.41. types.dt_lua_image_t.blue

see types.dt_lua_image_t.red

2.1.42. types.dt_lua_image_t.green

see types.dt_lua_image_t.red

2.1.43. types.dt_lua_image_t.yellow

see types.dt_lua_image_t.red

2.1.44. types.dt_lua_image_t.purple

see types.dt_lua_image_t.red

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.

2.1.48. types.dt_lua_image_t.make_group_leader

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.

2.1.50. types.dt_lua_image_t.group_leader

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:

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.