Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
exif.h File Reference

What a photograph says about itself: the EXIF, IPTC and XMP tags a camera and a cataloguer write, read into and out of dt_image_t. More...

Include dependency graph for exif.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum dt_dng_illuminant_t dt_dng_illuminant_t

Enumerations

enum  dt_dng_illuminant_t {
  DT_LS_Unknown = 0 ,
  DT_LS_Daylight = 1 ,
  DT_LS_Fluorescent = 2 ,
  DT_LS_Tungsten = 3 ,
  DT_LS_Flash = 4 ,
  DT_LS_FineWeather = 9 ,
  DT_LS_CloudyWeather = 10 ,
  DT_LS_Shade = 11 ,
  DT_LS_DaylightFluorescent = 12 ,
  DT_LS_DayWhiteFluorescent = 13 ,
  DT_LS_CoolWhiteFluorescent = 14 ,
  DT_LS_WhiteFluorescent = 15 ,
  DT_LS_WarmWhiteFluorescent = 16 ,
  DT_LS_StandardLightA = 17 ,
  DT_LS_StandardLightB = 18 ,
  DT_LS_StandardLightC = 19 ,
  DT_LS_D55 = 20 ,
  DT_LS_D65 = 21 ,
  DT_LS_D75 = 22 ,
  DT_LS_D50 = 23 ,
  DT_LS_ISOStudioTungsten = 24 ,
  DT_LS_Other = 255
}

Functions

void dt_exif_set_exiv2_taglist ()
const GList * dt_exif_get_exiv2_taglist ()
int dt_exif_read (dt_image_t *img, const char *path)
int dt_exif_read_from_blob (dt_image_t *img, uint8_t *blob, const int size)
void dt_exif_img_check_additional_tags (dt_image_t *img, const char *filename)
void dt_exif_read_usercrop (dt_image_t *img, const char *filename)
int dt_exif_write_blob (uint8_t *blob, uint32_t size, const char *path, const int compressed)
int dt_exif_get_thumbnail (const char *path, uint8_t **buffer, size_t *size, char **mime_type, int *width, int *height, int min_width)
void dt_exif_init ()
void dt_exif_cleanup ()
char * dt_exif_xmp_encode (const unsigned char *input, const int len, int *output_len)
char * dt_exif_xmp_encode_internal (const unsigned char *input, const int len, int *output_len, gboolean do_compress)
unsigned char * dt_exif_xmp_decode (const char *input, const int len, int *output_len)
dt_colorspaces_color_profile_type_t dt_exif_get_color_space (const uint8_t *data, size_t size)
void dt_exif_get_datetime_taken (const uint8_t *data, size_t size, char *datetime_taken)

Detailed Description

What a photograph says about itself: the EXIF, IPTC and XMP tags a camera and a cataloguer write, read into and out of dt_image_t.

This half of the old common/exif.cc names nothing above layer 1. The other half – the XMP sidecar that carries the development: history, masks, module order – reaches develop/ and imageio/, and lives in common/xmp_sidecar.h. The two met only in the XMP document, which is why they could be cut apart at all; what genuinely spans both is in metadata/exif_internal.h and is private to those two files.

Definition in file exif.h.

Typedef Documentation

◆ dt_dng_illuminant_t

wrapper around exiv2, C++

Enumeration Type Documentation

◆ dt_dng_illuminant_t

wrapper around exiv2, C++

Enumerator
DT_LS_Unknown 
DT_LS_Daylight 
DT_LS_Fluorescent 
DT_LS_Tungsten 
DT_LS_Flash 
DT_LS_FineWeather 
DT_LS_CloudyWeather 
DT_LS_Shade 
DT_LS_DaylightFluorescent 
DT_LS_DayWhiteFluorescent 
DT_LS_CoolWhiteFluorescent 
DT_LS_WhiteFluorescent 
DT_LS_WarmWhiteFluorescent 
DT_LS_StandardLightA 
DT_LS_StandardLightB 
DT_LS_StandardLightC 
DT_LS_D55 
DT_LS_D65 
DT_LS_D75 
DT_LS_D50 
DT_LS_ISOStudioTungsten 
DT_LS_Other 

Definition at line 58 of file exif.h.

Function Documentation

◆ dt_exif_cleanup()

void dt_exif_cleanup ( )

Definition at line 2443 of file exif.cc.

Referenced by dt_cleanup().

◆ dt_exif_get_color_space()

dt_colorspaces_color_profile_type_t dt_exif_get_color_space ( const uint8_t * data,
size_t size )

look for color space hints in data and tell the caller if it's sRGB, AdobeRGB or something else. used for mipmaps

Definition at line 2330 of file exif.cc.

References data, DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_DISPLAY, DT_COLORSPACE_SRGB, and size.

Referenced by dt_imageio_jpeg_read_color_space().

◆ dt_exif_get_datetime_taken()

void dt_exif_get_datetime_taken ( const uint8_t * data,
size_t size,
char * datetime_taken )

look for datetime_taken in data. used for gphoto downloads

Definition at line 2375 of file exif.cc.

References _find_datetime_taken(), data, and size.

◆ dt_exif_get_exiv2_taglist()

const GList * dt_exif_get_exiv2_taglist ( )

get the list of available tags from Exvi2 must not be freed

Definition at line 361 of file exif.cc.

◆ dt_exif_get_thumbnail()

int dt_exif_get_thumbnail ( const char * path,
uint8_t ** buffer,
size_t * size,
char ** mime_type,
int * width,
int * height,
int min_width )

fetch largest exif thumbnail jpg bytestream into buffer

Get the largest possible thumbnail from the image

Definition at line 1929 of file exif.cc.

References DT_DEBUG_LIGHTTABLE, dt_print(), height, IS_NULL_PTR, memcpy(), preview, selected, size, WIDEN, and width.

Referenced by dt_imageio_large_thumbnail().

◆ dt_exif_img_check_additional_tags()

void dt_exif_img_check_additional_tags ( dt_image_t * img,
const char * filename )

Reads exif tags that are not cached in the database

Definition at line 1055 of file exif.cc.

References _check_dng_opcodes(), _check_lens_correction_data(), _check_usercrop(), and WIDEN.

Referenced by dt_imageio_open_rawspeed().

◆ dt_exif_init()

void dt_exif_init ( )

thread safe init and cleanup.

Definition at line 2403 of file exif.cc.

References dt_exif_log_handler().

Referenced by dt_init().

◆ dt_exif_read()

int dt_exif_read ( dt_image_t * img,
const char * path )

◆ dt_exif_read_from_blob()

int dt_exif_read_from_blob ( dt_image_t * img,
uint8_t * blob,
const int size )

read exif data to image struct from given data blob, wherever you got it from.

Todo
: can this blob also contain xmp and iptc data?

Definition at line 1909 of file exif.cc.

References _exif_decode_exif_data(), dt_image_t::filename, res, and size.

Referenced by dt_imageio_open_exr().

◆ dt_exif_read_usercrop()

void dt_exif_read_usercrop ( dt_image_t * img,
const char * filename )

Reads only the DNG DefaultUserCrop tag into img->usercrop / img->usercrop_status.

Narrow entry point for consumers that need the camera framing without decoding the raw and without the side effects of the full additional-tags read (DNG opcodes allocate gain maps). Always leaves a definite status, never DT_IMAGE_USERCROP_UNKNOWN.

Definition at line 1031 of file exif.cc.

References _check_usercrop(), DT_IMAGE_USERCROP_ABSENT, dt_image_t::usercrop, dt_image_t::usercrop_status, and WIDEN.

Referenced by dt_image_resolve_usercrop().

◆ dt_exif_set_exiv2_taglist()

void dt_exif_set_exiv2_taglist ( )

set the list of available tags from Exvi2

Definition at line 271 of file exif.cc.

References _get_exiv2_type(), _get_xmp_tags(), dt_util_dstrcat(), and exiv2_taglist.

Referenced by dt_exif_get_exiv2_taglist(), and dt_init().

◆ dt_exif_write_blob()

int dt_exif_write_blob ( uint8_t * blob,
uint32_t size,
const char * path,
const int compressed )

write blob to file exif. merges with existing exif information.

Definition at line 2057 of file exif.cc.

References dt_remove_exif_keys(), i, key, size, and WIDEN.

Referenced by dt_imageio_write_dng(), write_image(), write_image(), write_image(), and write_image().

◆ dt_exif_xmp_decode()

unsigned char * dt_exif_xmp_decode ( const char * input,
const int len,
int * output_len )

◆ dt_exif_xmp_encode()

char * dt_exif_xmp_encode ( const unsigned char * input,
const int len,
int * output_len )

encode / decode op params.

Used by the XMP sidecar to serialise module parameter blobs, and by anything that has to read one back; they are here rather than beside the sidecar because they are a codec, not a document format – common/styles.c and common/presets.c use them too.

Definition at line 2116 of file exif.cc.

References COMPRESS_THRESHOLD, dt_conf_get_string(), dt_exif_xmp_encode_internal(), dt_free, FALSE, and TRUE.

Referenced by _exif_xmp_append_history_hash(), _init_presets(), _write_item(), _xmp_append_history(), _xmp_append_mask(), and dt_presets_save_to_file().

◆ dt_exif_xmp_encode_internal()

char * dt_exif_xmp_encode_internal ( const unsigned char * input,
const int len,
int * output_len,
gboolean do_compress )

Definition at line 2142 of file exif.cc.

References dt_free, factor, i, IS_NULL_PTR, and MIN.

Referenced by dt_exif_xmp_encode(), encode_colorchecker(), and encode_tonecurve().