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

The XMP document that carries an image's development: history stack, mask shapes, module order, and the EXIF blob written alongside an export. More...

#include "common/image.h"
+ Include dependency graph for xmp_sidecar.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int dt_exif_read_blob (uint8_t **blob, const char *path, const int32_t imgid, const int sRGB, const int out_width, const int out_height, const int dng_mode)
 
int dt_exif_xmp_write_with_imgpath (const struct dt_image_t *image, const char *filename, const char *imgpath)
 
int dt_exif_xmp_attach_export (const int32_t imgid, const char *filename, void *metadata)
 
char * dt_exif_xmp_read_string (const int32_t imgid)
 
int dt_exif_xmp_read (dt_image_t *img, const char *filename, const int history_only)
 

Detailed Description

The XMP document that carries an image's development: history stack, mask shapes, module order, and the EXIF blob written alongside an export.

This is the half of the old common/exif.cc that is not about the photograph's own description. It reads and writes Xmp.darktable.history, masks_history, iop_order_list and their neighbours, so it necessarily names develop/ (layer 5) and imageio/ (layer 6) – eleven dt_ioppr_* symbols, dt_develop_blend_params_t, dt_masks_form_group_t, dt_imageio_dng_write_tiff_header. That is precisely why it could not follow the tag half into src/metadata (layer 1), and why the metadata module gate still reads zero without it.

It belongs in src/history – it serialises the development, not the photograph – and moves there when that module exists. The dt_exif_* names are kept for now so the cut itself stays reviewable; renaming them is that move's business, not this one's.

Definition in file xmp_sidecar.h.

Function Documentation

◆ dt_exif_read_blob()

int dt_exif_read_blob ( uint8_t **  blob,
const char *  path,
const int32_t  imgid,
const int  sRGB,
const int  out_width,
const int  out_height,
const int  dng_mode 
)

write exif to blob, return length in bytes. blob will be allocated by the function. sRGB should be true if sRGB colorspace is used as output.

Todo:
: find a nice place for the missing metadata (tags, publisher, colorlabels?). Additionally find out

Definition at line 249 of file xmp_sidecar.cc.

References darktable_package_string, dt_conf_get_int(), DT_DATETIME_EXIF_LENGTH, dt_datetime_img_to_exif(), DT_DATETIME_LENGTH, dt_datetime_now_to_exif(), dt_free, dt_free_gpointer(), dt_image_cache_get(), dt_image_cache_read_release(), dt_metadata_get(), dt_remove_exif_geotag(), dt_remove_exif_keys(), i, IS_NULL_PTR, L, read_metadata_threadsafe, sRGB, and WIDEN.

Referenced by dt_control_merge_hdr_job_run(), and dt_imageio_export_with_flags().

◆ dt_exif_xmp_attach_export()

◆ dt_exif_xmp_read()

int dt_exif_xmp_read ( dt_image_t img,
const char *  filename,
const int  history_only 
)

read xmp sidecar file.

Todo:
: make this configurable? or remove it altogether?

Definition at line 1212 of file xmp_sidecar.cc.

References add_mask_entries_to_db(), add_mask_entry_to_db(), add_non_clone_mask_entries_to_db(), history_entry_t::blendop_params, history_entry_t::blendop_params_len, history_entry_t::blendop_version, dt_database_get_last_error(), dt_database_release_transaction, dt_database_rollback_transaction(), dt_database_start_transaction, dt_deprecated(), dt_exif_decode_xmp_data(), dt_exif_xmp_decode(), dt_free, dt_free_gpointer(), dt_history_repository_count_mask_items(), dt_history_repository_delete_history(), dt_history_repository_delete_masks_history(), dt_history_repository_get_next_num(), dt_history_repository_set_end(), dt_history_repository_shift_nums(), dt_history_repository_write_item(), DT_IMAGE_AUTO_PRESETS_APPLIED, DT_IMAGE_NO_LEGACY_PRESETS, DT_IOP_ORDER_ANSEL_RAW, DT_IOP_ORDER_LEGACY, dt_ioppr_deserialize_text_iop_order_list(), dt_ioppr_get_iop_order_link(), dt_ioppr_get_iop_order_list_version(), dt_ioppr_insert_missing_modules(), dt_ioppr_write_iop_order_list(), dt_sort_iop_list_by_order_f(), history_entry_t::enabled, FALSE, dt_image_t::flags, free_history_entry(), free_mask_entry(), dt_image_t::history_hash, dt_image_t::id, dt_iop_order_entry_t::instance, history_entry_t::iop_order, dt_iop_order_entry_t::iop_order_f, IS_NULL_PTR, L, dt_image_raw_parameters_t::legacy, dt_image_t::legacy_flip, MIN, history_entry_t::modversion, history_entry_t::multi_name, history_entry_t::multi_priority, history_entry_t::num, dt_iop_order_entry_t::o, history_entry_t::operation, dt_iop_order_entry_t::operation, out, history_entry_t::params, history_entry_t::params_len, read_history_v1(), read_history_v2(), read_masks(), read_masks_v3(), read_metadata_threadsafe, read_xmp_timestamps(), TRUE, dt_image_raw_parameters_t::user_flip, and WIDEN.

Referenced by _history_load_and_apply_apply(), _image_import_internal(), dt_image_read_duplicates(), and main().

◆ dt_exif_xmp_read_string()

char * dt_exif_xmp_read_string ( const int32_t  imgid)

get the xmp blob for imgid.

Definition at line 2192 of file xmp_sidecar.cc.

References _exif_xmp_read_data(), dt_image_full_path(), dt_image_path_append_version(), dt_remove_known_keys(), ERROR_CODE, FALSE, L, lock, PATH_MAX, and WIDEN.

Referenced by write_image(), and write_image().

◆ dt_exif_xmp_write_with_imgpath()

int dt_exif_xmp_write_with_imgpath ( const struct dt_image_t image,
const char *  filename,
const char *  imgpath 
)

write xmp sidecar file.