![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include <errno.h>#include <glib.h>#include <sqlite3.h>#include <sys/stat.h>#include <sys/types.h>#include <time.h>#include <unistd.h>#include <zlib.h>#include <array>#include <cassert>#include <cmath>#include <cstdlib>#include <cstring>#include <fstream>#include <iostream>#include <sstream>#include <string>#include <exiv2/exiv2.hpp>#include <pugixml.hpp>#include "common/colorlabels.h"#include "common/darktable.h"#include "common/deprecations.h"#include "common/debug.h"#include "common/dng_opcode.h"#include "common/image_cache.h"#include "common/imageio.h"#include "common/exif.h"#include "common/imageio_jpeg.h"#include "common/metadata.h"#include "common/ratings.h"#include "common/tags.h"#include "common/iop_order.h"#include "common/variables.h"#include "common/utility.h"#include "common/history.h"#include "common/datetime.h"#include "control/conf.h"#include "control/control.h"#include "develop/imageop.h"#include "develop/blend.h"#include "develop/masks.h"
Include dependency graph for exif.cc:Go to the source code of this file.
Data Structures | |
| class | Lock |
| struct | history_entry_t |
| struct | mask_entry_t |
Macros | |
| #define | __STDC_FORMAT_MACROS |
| #define | WIDEN(s) (s) |
| #define | DT_XMP_EXIF_VERSION 5 |
| #define | read_metadata_threadsafe(image) |
| #define | FIND_XMP_TAG(key) dt_exif_read_xmp_tag(xmpData, &pos, key) |
| #define | FIND_IPTC_TAG(key) dt_exif_read_iptc_tag(iptcData, &pos, key) |
| #define | FIND_EXIF_TAG(key) _exif_read_exif_tag(exifData, &pos, key) |
| #define | COMPRESS_THRESHOLD 100 |
| #define | TO_BINARY(a) (a > 57 ? a - 97 + 10 : a - 48) |
| #define | ERROR_CODE(a) (a) |
Typedefs | |
| typedef struct history_entry_t | history_entry_t |
| typedef struct mask_entry_t | mask_entry_t |
Functions | |
| static const char * | _get_exiv2_type (const int type) |
| static void | _get_xmp_tags (const char *prefix, GList **taglist) |
| static int | _illu_to_temp (dt_dng_illuminant_t illu) |
| void | dt_exif_set_exiv2_taglist () |
| const GList * | dt_exif_get_exiv2_taglist () |
| static const char * | _exif_get_exiv2_tag_type (const char *tagname) |
| static void | _exif_import_tags (dt_image_t *img, Exiv2::XmpData::iterator &pos) |
| static void | read_xmp_timestamps (Exiv2::XmpData &xmpData, dt_image_t *img, const int xmp_version) |
| static void | dt_strlcpy_to_utf8 (char *dest, size_t dest_max, Exiv2::ExifData::const_iterator &pos, Exiv2::ExifData &exifData) |
| static void | dt_remove_known_keys (Exiv2::XmpData &xmp) |
| static void | dt_remove_exif_keys (Exiv2::ExifData &exif, const char *keys[], unsigned int n_keys) |
| static void | dt_remove_xmp_keys (Exiv2::XmpData &xmp, const char *keys[], unsigned int n_keys) |
| static bool | dt_exif_read_xmp_tag (Exiv2::XmpData &xmpData, Exiv2::XmpData::iterator *pos, string key) |
| static bool | _exif_decode_xmp_data (dt_image_t *img, Exiv2::XmpData &xmpData, int version, bool exif_read) |
| static bool | dt_exif_read_iptc_tag (Exiv2::IptcData &iptcData, Exiv2::IptcData::const_iterator *pos, string key) |
| static bool | _exif_decode_iptc_data (dt_image_t *img, Exiv2::IptcData &iptcData) |
| static bool | _exif_read_exif_tag (Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator *pos, string key) |
| static bool | _check_usercrop (Exiv2::ExifData &exifData, dt_image_t *img) |
| static gboolean | _check_dng_opcodes (Exiv2::ExifData &exifData, dt_image_t *img) |
| void | dt_exif_img_check_additional_tags (dt_image_t *img, const char *filename) |
| static void | _find_datetime_taken (Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator pos, char *exif_datetime_taken) |
| static void | _find_exif_maker (Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator pos, char *maker, const size_t m_size) |
| static void | _find_exif_model (Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator pos, char *model, const size_t m_size) |
| static bool | _exif_decode_exif_data (dt_image_t *img, Exiv2::ExifData &exifData) |
| int | dt_exif_read_from_blob (dt_image_t *img, uint8_t *blob, const int size) |
| int | dt_exif_get_thumbnail (const char *path, uint8_t **buffer, size_t *size, char **mime_type, int *width, int *height, int min_width) |
| int | dt_exif_read (dt_image_t *img, const char *path) |
| int | dt_exif_write_blob (uint8_t *blob, uint32_t size, const char *path, const int compressed) |
| static void | dt_remove_exif_geotag (Exiv2::ExifData &exifData) |
| int | dt_exif_read_blob (uint8_t **buf, const char *path, const int32_t imgid, const int sRGB, const int out_width, const int out_height, const int dng_mode) |
| 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) |
| static void | print_history_entry (history_entry_t *entry) __attribute__((unused)) |
| static void | free_history_entry (gpointer data) |
| static GList * | read_history_v1 (const std::string &xmpPacket, const char *filename, const int superold) |
| static GList * | read_history_v2 (Exiv2::XmpData &xmpData, const char *filename) |
| void | free_mask_entry (gpointer data) |
| static GHashTable * | read_masks (Exiv2::XmpData &xmpData, const char *filename, const int version) |
| static GList * | read_masks_v3 (Exiv2::XmpData &xmpData, const char *filename, const int version) |
| static void | add_mask_entry_to_db (int32_t imgid, mask_entry_t *entry) |
| static void | add_non_clone_mask_entries_to_db (gpointer key, gpointer value, gpointer user_data) |
| static void | add_mask_entries_to_db (int32_t imgid, GHashTable *mask_entries, int mask_id) |
| int | _get_max_multi_priority (GList *history, const char *operation) |
| int | dt_exif_xmp_read (dt_image_t *img, const char *filename, const int history_only) |
| static void | dt_set_xmp_dt_history (Exiv2::XmpData &xmpData, const int32_t imgid, int history_end) |
| static void | set_xmp_timestamps (Exiv2::XmpData &xmpData, const int32_t imgid) |
| GTimeSpan | _convert_unix_to_gtimespan (const time_t unix) |
| static void | dt_remove_xmp_exif_geotag (Exiv2::XmpData &xmpData) |
| static void | dt_set_xmp_exif_geotag (Exiv2::XmpData &xmpData, double longitude, double latitude, double altitude) |
| static void | dt_set_xmp_dt_metadata (Exiv2::XmpData &xmpData, const int32_t imgid, const gboolean export_flag) |
| static void | _exif_xmp_append_history_hash (Exiv2::XmpData &xmpData, const int32_t imgid, const dt_image_t *image) |
| static void | _exif_xmp_read_data (Exiv2::XmpData &xmpData, const int32_t imgid, const dt_image_t *image) |
| static void | _exif_xmp_read_data_export (Exiv2::XmpData &xmpData, const int32_t imgid, dt_export_metadata_t *metadata) |
| char * | dt_exif_xmp_read_string (const int32_t imgid) |
| static void | dt_remove_xmp_key (Exiv2::XmpData &xmp, const char *key) |
| static void | _remove_xmp_keys (Exiv2::XmpData &xmpData, const char *key) |
| static void | dt_remove_exif_key (Exiv2::ExifData &exif, const char *key) |
| static void | dt_remove_iptc_key (Exiv2::IptcData &iptc, const char *key) |
| int | dt_exif_xmp_attach_export (const int32_t imgid, const char *filename, void *metadata) |
| int | dt_exif_xmp_write_with_imgpath (const dt_image_t *image, const char *filename, const char *imgpath) |
| 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) |
| static void | dt_exif_log_handler (int log_level, const char *message) |
| void | dt_exif_init () |
| void | dt_exif_cleanup () |
Variables | |
| static GList * | exiv2_taglist = NULL |
| const char * | dt_xmp_keys [] |
| static const guint | dt_xmp_keys_n = G_N_ELEMENTS(dt_xmp_keys) |
| #define COMPRESS_THRESHOLD 100 |
| #define FIND_EXIF_TAG | ( | key | ) | _exif_read_exif_tag(exifData, &pos, key) |
| #define FIND_IPTC_TAG | ( | key | ) | dt_exif_read_iptc_tag(iptcData, &pos, key) |
| #define FIND_XMP_TAG | ( | key | ) | dt_exif_read_xmp_tag(xmpData, &pos, key) |
| #define read_metadata_threadsafe | ( | image | ) |
| #define TO_BINARY | ( | a | ) | (a > 57 ? a - 97 + 10 : a - 48) |
| typedef struct history_entry_t history_entry_t |
| typedef struct mask_entry_t mask_entry_t |
|
static |
Definition at line 814 of file exif.cc.
References DT_DEBUG_IMAGEIO, dt_dng_opcode_process_opcode_list_2(), dt_free, dt_vprint(), FALSE, and TRUE.
Referenced by _exif_decode_exif_data(), and dt_exif_img_check_additional_tags().
|
static |
Definition at line 788 of file exif.cc.
References FALSE, i, TRUE, and dt_image_t::usercrop.
Referenced by _exif_decode_exif_data(), and dt_exif_img_check_additional_tags().
| GTimeSpan _convert_unix_to_gtimespan | ( | const time_t | unix | ) |
Definition at line 3671 of file exif.cc.
References dt_datetime_gdatetime_to_gtimespan().
Referenced by read_xmp_timestamps().
|
static |
Definition at line 927 of file exif.cc.
References _check_dng_opcodes(), _check_usercrop(), _find_datetime_taken(), _find_exif_maker(), _find_exif_model(), _illu_to_temp(), dt_image_t::colorspace, dt_image_t::d65_color_matrix, darktable, dt_datetime_exif_to_img(), DT_DATETIME_LENGTH, DT_DEBUG_IMAGEIO, dt_free, DT_IMAGE_COLORSPACE_ADOBE_RGB, DT_IMAGE_COLORSPACE_SRGB, DT_IMAGE_HAS_ADDITIONAL_DNG_TAGS, DT_IMAGE_HDR, dt_image_is_raw(), DT_IMAGE_MONOCHROME, dt_image_orientation_to_flip_bits(), dt_image_refresh_makermodel(), dt_image_set_xmp_rating(), DT_LS_CloudyWeather, DT_LS_CoolWhiteFluorescent, DT_LS_D50, DT_LS_D55, DT_LS_D65, DT_LS_D75, DT_LS_Daylight, DT_LS_DaylightFluorescent, DT_LS_DayWhiteFluorescent, DT_LS_FineWeather, DT_LS_Flash, DT_LS_Fluorescent, DT_LS_ISOStudioTungsten, DT_LS_Shade, DT_LS_StandardLightA, DT_LS_StandardLightB, DT_LS_StandardLightC, DT_LS_Tungsten, DT_LS_Unknown, DT_LS_WarmWhiteFluorescent, DT_LS_WhiteFluorescent, dt_metadata_set_import(), dt_strlcpy_to_utf8(), dt_tag_attach(), dt_tag_new(), dt_util_gps_elevation_to_number(), dt_util_gps_rationale_to_number(), dt_image_geoloc_t::elevation, dt_image_t::exif_aperture, dt_image_t::exif_crop, dt_image_t::exif_exposure, dt_image_t::exif_exposure_bias, dt_image_t::exif_focal_length, dt_image_t::exif_focus_distance, dt_image_t::exif_inited, dt_image_t::exif_iso, dt_image_t::exif_lens, dt_image_t::exif_maker, dt_image_t::exif_model, FALSE, dt_image_t::filename, FIND_EXIF_TAG, dt_image_t::flags, dt_image_t::geoloc, i, dt_image_t::id, dt_image_geoloc_t::latitude, dt_image_geoloc_t::longitude, mat3mul(), dt_image_t::orientation, sign, TRUE, darktable_t::unmuted, and value.
Referenced by dt_exif_read(), and dt_exif_read_from_blob().
|
static |
Definition at line 690 of file exif.cc.
References darktable, dt_datetime_exif_to_img(), DT_DEBUG_CONTROL_SIGNAL_RAISE, dt_free, dt_metadata_set_import(), DT_SIGNAL_TAG_CHANGED, dt_tag_attach(), dt_tag_new(), dt_util_foo_to_utf8(), FALSE, dt_image_t::filename, FIND_IPTC_TAG, dt_image_t::id, key, darktable_t::signals, and TRUE.
Referenced by dt_exif_read().
|
static |
Definition at line 519 of file exif.cc.
References _exif_import_tags(), dt_colorlabels_remove_labels(), dt_colorlabels_set_label(), dt_conf_get_bool(), dt_datetime_exif_to_img(), dt_free, dt_image_get_xmp_mode(), dt_image_set_xmp_rating(), dt_metadata_clear(), dt_metadata_get_key(), DT_METADATA_NUMBER, dt_metadata_set_import(), dt_tag_set_tags(), dt_util_gps_elevation_to_number(), dt_util_gps_string_to_number(), dt_image_geoloc_t::elevation, dt_image_t::exif_lens, FALSE, dt_image_t::filename, FIND_XMP_TAG, dt_image_t::geoloc, i, dt_image_t::id, IS_NULL_PTR, key, dt_image_geoloc_t::latitude, dt_image_geoloc_t::longitude, sign, TRUE, and value.
Referenced by dt_exif_read(), and dt_exif_xmp_read().
|
static |
Definition at line 363 of file exif.cc.
References exiv2_taglist, IS_NULL_PTR, and t.
Referenced by dt_exif_xmp_attach_export().
|
static |
Definition at line 2424 of file exif.cc.
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, i, dt_image_t::id, and k.
Referenced by _exif_decode_xmp_data().
|
static |
|
static |
Definition at line 3810 of file exif.cc.
References darktable, dt_exif_xmp_encode(), dt_free, dt_image_cache_get(), dt_image_cache_read_release(), dt_image_t::history_hash, darktable_t::image_cache, IS_NULL_PTR, and value.
Referenced by _exif_xmp_read_data(), and _exif_xmp_read_data_export().
|
static |
Definition at line 3834 of file exif.cc.
References _exif_xmp_append_history_hash(), darktable, darktable_t::db, dt_database_get(), dt_datetime_gtimespan_to_exif(), DT_DATETIME_LENGTH, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_free, dt_free_gpointer(), DT_IMAGE_AUTO_PRESETS_APPLIED, dt_image_get_xmp_rating_from_flags(), DT_IOP_ORDER_ANSEL_RAW, DT_IOP_ORDER_CUSTOM, dt_ioppr_get_iop_order_list(), dt_ioppr_get_iop_order_version(), dt_ioppr_has_multiple_instances(), dt_ioppr_serialize_text_iop_order_list(), dt_set_xmp_dt_history(), dt_set_xmp_dt_metadata(), dt_set_xmp_exif_geotag(), dt_tag_get_hierarchical(), dt_tag_get_list(), DT_XMP_EXIF_VERSION, FALSE, set_xmp_timestamps(), and TRUE.
Referenced by dt_exif_xmp_read_string(), and dt_exif_xmp_write_with_imgpath().
|
static |
Definition at line 3966 of file exif.cc.
References _exif_xmp_append_history_hash(), darktable, darktable_t::db, dt_database_get(), dt_datetime_gtimespan_to_exif(), DT_DATETIME_LENGTH, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_free, dt_free_gpointer(), DT_IMAGE_AUTO_PRESETS_APPLIED, dt_image_get_xmp_rating_from_flags(), DT_IOP_ORDER_ANSEL_RAW, DT_IOP_ORDER_CUSTOM, dt_ioppr_get_iop_order_list(), dt_ioppr_get_iop_order_version(), dt_ioppr_has_multiple_instances(), dt_ioppr_serialize_text_iop_order_list(), DT_META_DT_HISTORY, DT_META_EXIF, DT_META_GEOTAG, DT_META_HIERARCHICAL_TAG, DT_META_METADATA, DT_META_TAG, dt_remove_xmp_exif_geotag(), dt_set_xmp_dt_history(), dt_set_xmp_dt_metadata(), dt_set_xmp_exif_geotag(), dt_tag_get_hierarchical_export(), dt_tag_get_list_export(), DT_XMP_EXIF_VERSION, dt_export_metadata_t::flags, and TRUE.
Referenced by dt_exif_xmp_attach_export().
|
static |
Definition at line 860 of file exif.cc.
References dt_datetime_add_subsec_to_exif(), DT_DATETIME_EXIF_LENGTH, DT_DATETIME_LENGTH, dt_strlcpy_to_utf8(), and FIND_EXIF_TAG.
Referenced by _exif_decode_exif_data(), and dt_exif_get_datetime_taken().
|
static |
Definition at line 882 of file exif.cc.
References dt_strlcpy_to_utf8(), FIND_EXIF_TAG, and maker.
Referenced by _exif_decode_exif_data().
|
static |
Definition at line 905 of file exif.cc.
References dt_strlcpy_to_utf8(), FIND_EXIF_TAG, and model.
Referenced by _exif_decode_exif_data().
|
static |
Definition at line 145 of file exif.cc.
References type.
Referenced by _get_xmp_tags(), and dt_exif_set_exiv2_taglist().
| int _get_max_multi_priority | ( | GList * | history, |
| const char * | operation | ||
| ) |
Definition at line 3089 of file exif.cc.
References MAX, history_entry_t::multi_priority, and history_entry_t::operation.
|
static |
Definition at line 210 of file exif.cc.
References _get_exiv2_type(), dt_util_dstrcat(), and i.
Referenced by dt_exif_set_exiv2_taglist().
|
static |
Definition at line 223 of file exif.cc.
References DT_LS_CloudyWeather, DT_LS_CoolWhiteFluorescent, DT_LS_D50, DT_LS_D55, DT_LS_D65, DT_LS_D75, DT_LS_Daylight, DT_LS_DaylightFluorescent, DT_LS_DayWhiteFluorescent, DT_LS_FineWeather, DT_LS_Flash, DT_LS_Fluorescent, DT_LS_ISOStudioTungsten, DT_LS_Shade, DT_LS_StandardLightA, DT_LS_StandardLightB, DT_LS_StandardLightC, DT_LS_Tungsten, DT_LS_WarmWhiteFluorescent, and DT_LS_WhiteFluorescent.
Referenced by _exif_decode_exif_data().
|
static |
Definition at line 4197 of file exif.cc.
Referenced by dt_exif_xmp_attach_export().
|
static |
Definition at line 3063 of file exif.cc.
References add_mask_entries_to_db(), add_mask_entry_to_db(), DT_MASKS_GROUP, i, IS_NULL_PTR, mask_id, mask_entry_t::mask_nb, mask_entry_t::mask_points, mask_entry_t::mask_points_len, and mask_entry_t::mask_type.
Referenced by add_mask_entries_to_db(), and dt_exif_xmp_read().
|
static |
Definition at line 3014 of file exif.cc.
References mask_entry_t::already_added, darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_BLOB, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, mask_entry_t::mask_id, mask_entry_t::mask_name, mask_entry_t::mask_nb, mask_entry_t::mask_num, mask_entry_t::mask_points, mask_entry_t::mask_points_len, mask_entry_t::mask_src, mask_entry_t::mask_src_len, mask_entry_t::mask_type, mask_entry_t::mask_version, TRUE, and mask_entry_t::version.
Referenced by add_mask_entries_to_db(), add_non_clone_mask_entries_to_db(), and dt_exif_xmp_read().
|
static |
Definition at line 3056 of file exif.cc.
References add_mask_entry_to_db(), DT_MASKS_CLONE, DT_MASKS_NON_CLONE, mask_entry_t::mask_type, and value.
Referenced by dt_exif_xmp_read().
| void dt_exif_cleanup | ( | ) |
Definition at line 4705 of file exif.cc.
Referenced by dt_cleanup().
| 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 4592 of file exif.cc.
References DT_COLORSPACE_ADOBERGB, DT_COLORSPACE_DISPLAY, DT_COLORSPACE_SRGB, and size.
Referenced by dt_imageio_jpeg_read_color_space().
| 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 4637 of file exif.cc.
References _find_datetime_taken(), read_metadata_threadsafe, and size.
| const GList * dt_exif_get_exiv2_taglist | ( | ) |
get the list of available tags from Exvi2 must not be freed
Definition at line 356 of file exif.cc.
References dt_exif_set_exiv2_taglist(), and exiv2_taglist.
Referenced by dt_lib_export_metadata_configuration_dialog().
| int dt_exif_get_thumbnail | ( | const char * | path, |
| uint8_t ** | buffer, | ||
| size_t * | size, | ||
| char ** | mime_type, | ||
| int * | width, | ||
| int * | height, | ||
| int | min_width | ||
| ) |
Get the largest possible thumbnail from the image
Definition at line 1702 of file exif.cc.
References DT_DEBUG_LIGHTTABLE, dt_print(), height, IS_NULL_PTR, read_metadata_threadsafe, size, WIDEN, and width.
Referenced by dt_imageio_large_thumbnail().
| 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 836 of file exif.cc.
References _check_dng_opcodes(), _check_usercrop(), read_metadata_threadsafe, and WIDEN.
Referenced by dt_imageio_open_rawspeed().
| void dt_exif_init | ( | ) |
thread safe init and cleanup.
Definition at line 4665 of file exif.cc.
References dt_exif_log_handler().
Referenced by dt_init().
|
static |
Definition at line 4655 of file exif.cc.
References DT_DEBUG_CAMERA_SUPPORT, and dt_print().
Referenced by dt_exif_init().
| int dt_exif_read | ( | dt_image_t * | img, |
| const char * | path | ||
| ) |
read the metadata of an image. XMP data trumps IPTC data trumps EXIF data
Definition at line 1753 of file exif.cc.
References _exif_decode_exif_data(), _exif_decode_iptc_data(), _exif_decode_xmp_data(), dt_datetime_unix_to_img(), DT_IMAGE_HDR, DT_IMAGE_LDR, DT_IMAGE_RAW, DT_IMAGE_S_RAW, dt_imageio_get_type_from_extension(), dt_image_t::exif_inited, dt_image_t::flags, dt_image_t::height, read_metadata_threadsafe, WIDEN, and dt_image_t::width.
Referenced by _image_import_internal(), _import_copy_file(), _set_test_path(), dt_control_refresh_exif_run(), dt_imageio_open_j2k(), dt_imageio_open_jpeg(), dt_imageio_open_png(), dt_imageio_open_rawspeed(), dt_imageio_open_tiff(), and update_preview_cb().
| 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.
Definition at line 1890 of file exif.cc.
References darktable, 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(), dt_image_geoloc_t::elevation, dt_image_t::geoloc, i, darktable_t::image_cache, IS_NULL_PTR, dt_image_geoloc_t::latitude, dt_image_geoloc_t::longitude, read_metadata_threadsafe, sRGB, and WIDEN.
Referenced by dt_control_merge_hdr_job_run(), and dt_imageio_export_with_flags().
| int dt_exif_read_from_blob | ( | dt_image_t * | img, |
| uint8_t * | blob, | ||
| const int | size | ||
| ) |
Definition at line 1682 of file exif.cc.
References _exif_decode_exif_data(), dt_image_t::filename, and size.
Referenced by dt_imageio_open_exr().
|
static |
|
static |
| void dt_exif_set_exiv2_taglist | ( | ) |
set the list of available tags from Exvi2
Definition at line 266 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().
| 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 1816 of file exif.cc.
References dt_remove_exif_keys(), i, key, read_metadata_threadsafe, size, and WIDEN.
Referenced by dt_imageio_write_dng(), write_image(), write_image(), write_image(), and write_image().
| int dt_exif_xmp_attach_export | ( | const int32_t | imgid, |
| const char * | filename, | ||
| void * | metadata | ||
| ) |
write xmp packet inside an image.
Definition at line 4241 of file exif.cc.
References _exif_get_exiv2_tag_type(), _exif_read_exif_tag(), _exif_xmp_read_data_export(), _remove_xmp_keys(), dt_free, dt_image_full_path(), dt_image_path_append_version(), DT_META_EXIF, DT_META_GEOTAG, dt_remove_exif_geotag(), dt_remove_exif_key(), dt_remove_iptc_key(), dt_remove_known_keys(), dt_remove_xmp_key(), dt_remove_xmp_keys(), dt_variables_expand(), dt_variables_params_destroy(), dt_variables_params_init(), dt_variables_set_tags_flags(), FALSE, i, IS_NULL_PTR, key, m, PATH_MAX, read_metadata_threadsafe, TRUE, type, and WIDEN.
Referenced by dt_imageio_export_with_flags().
| unsigned char * dt_exif_xmp_decode | ( | const char * | input, |
| const int | len, | ||
| int * | output_len | ||
| ) |
Definition at line 2337 of file exif.cc.
References dt_free, factor, i, IS_NULL_PTR, and TO_BINARY.
Referenced by add_preset(), dt_exif_xmp_read(), dt_presets_import_from_file(), dt_style_plugin_save(), init_presets(), read_history_v1(), read_history_v2(), read_masks(), and read_masks_v3().
| char * dt_exif_xmp_encode | ( | const unsigned char * | input, |
| const int | len, | ||
| int * | output_len | ||
| ) |
encode / decode op params
Definition at line 2246 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(), dt_preset_encode(), dt_set_xmp_dt_history(), and dt_style_encode().
| char * dt_exif_xmp_encode_internal | ( | const unsigned char * | input, |
| const int | len, | ||
| int * | output_len, | ||
| gboolean | do_compress | ||
| ) |
Definition at line 2272 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().
| int dt_exif_xmp_read | ( | dt_image_t * | img, |
| const char * | filename, | ||
| const int | history_only | ||
| ) |
read xmp sidecar file.
Definition at line 3105 of file exif.cc.
References _exif_decode_xmp_data(), 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, darktable, darktable_t::db, dt_database_get(), dt_database_release_transaction, dt_database_rollback_transaction(), dt_database_start_transaction, DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_deprecated(), dt_exif_xmp_decode(), dt_free, dt_free_gpointer(), dt_history_db_delete_history(), dt_history_db_delete_masks_history(), dt_history_db_get_next_history_num(), dt_history_db_shift_history_nums(), dt_history_db_write_history_item(), dt_history_set_end(), 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_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, 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().
| char * dt_exif_xmp_read_string | ( | const int32_t | imgid | ) |
get the xmp blob for imgid.
Definition at line 4116 of file exif.cc.
References _exif_xmp_read_data(), dt_image_full_path(), dt_image_path_append_version(), dt_remove_known_keys(), ERROR_CODE, FALSE, PATH_MAX, and WIDEN.
Referenced by write_image(), and write_image().
| int dt_exif_xmp_write_with_imgpath | ( | const dt_image_t * | image, |
| const char * | filename, | ||
| const char * | imgpath | ||
| ) |
Definition at line 4486 of file exif.cc.
References _exif_xmp_read_data(), dt_control_log(), dt_free, dt_read_file(), dt_remove_known_keys(), ERROR_CODE, dt_image_t::id, IS_NULL_PTR, TRUE, and WIDEN.
Referenced by _write_sidecar_file_from_image_locked(), and write_image().
|
static |
Definition at line 1874 of file exif.cc.
References dt_remove_exif_keys().
Referenced by dt_exif_read_blob(), and dt_exif_xmp_attach_export().
|
static |
|
static |
Definition at line 460 of file exif.cc.
References i.
Referenced by dt_exif_read_blob(), dt_exif_write_blob(), and dt_remove_exif_geotag().
|
static |
|
static |
Definition at line 440 of file exif.cc.
References dt_xmp_keys, dt_xmp_keys_n, i, and key.
Referenced by dt_exif_xmp_attach_export(), dt_exif_xmp_read_string(), and dt_exif_xmp_write_with_imgpath().
|
static |
Definition at line 3712 of file exif.cc.
References dt_remove_xmp_keys().
Referenced by _exif_xmp_read_data_export(), and dt_set_xmp_exif_geotag().
|
static |
|
static |
Definition at line 480 of file exif.cc.
References i.
Referenced by dt_exif_xmp_attach_export(), dt_remove_xmp_exif_geotag(), and set_xmp_timestamps().
|
static |
Definition at line 3498 of file exif.cc.
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_exif_xmp_encode(), dt_free, IS_NULL_PTR, key, mask_id, mask_name, and MIN.
Referenced by _exif_xmp_read_data(), and _exif_xmp_read_data_export().
|
static |
Definition at line 3768 of file exif.cc.
References darktable, darktable_t::db, dt_conf_get_int(), dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, dt_free, DT_METADATA_FLAG_HIDDEN, DT_METADATA_FLAG_PRIVATE, dt_metadata_get_key(), dt_metadata_get_name(), dt_metadata_get_type(), DT_METADATA_TYPE_INTERNAL, dt_util_dstrcat(), flag, name, and v.
Referenced by _exif_xmp_read_data(), and _exif_xmp_read_data_export().
|
static |
Definition at line 3726 of file exif.cc.
References double(), dt_free, and dt_remove_xmp_exif_geotag().
Referenced by _exif_xmp_read_data(), and _exif_xmp_read_data_export().
|
static |
Definition at line 421 of file exif.cc.
References dt_free, and IS_NULL_PTR.
Referenced by _exif_decode_exif_data(), _find_datetime_taken(), _find_exif_maker(), and _find_exif_model().
|
static |
Definition at line 2543 of file exif.cc.
References history_entry_t::blendop_params, dt_free, history_entry_t::multi_name, history_entry_t::operation, and history_entry_t::params.
Referenced by dt_exif_xmp_read(), and read_history_v2().
| void free_mask_entry | ( | gpointer | data | ) |
Definition at line 2834 of file exif.cc.
References dt_free, mask_entry_t::mask_name, mask_entry_t::mask_points, and mask_entry_t::mask_src.
Referenced by dt_exif_xmp_read(), read_masks(), and read_masks_v3().
|
static |
Definition at line 2523 of file exif.cc.
References history_entry_t::blendop_params, history_entry_t::blendop_version, history_entry_t::enabled, history_entry_t::iop_order, IS_NULL_PTR, history_entry_t::modversion, history_entry_t::multi_name, history_entry_t::multi_priority, history_entry_t::operation, and history_entry_t::params.
|
static |
Definition at line 2556 of file exif.cc.
References history_entry_t::blendop_params, history_entry_t::blendop_params_len, history_entry_t::blendop_version, dt_exif_xmp_decode(), history_entry_t::enabled, history_entry_t::iop_order, history_entry_t::modversion, history_entry_t::multi_name, history_entry_t::multi_priority, history_entry_t::operation, history_entry_t::params, and history_entry_t::params_len.
Referenced by dt_exif_xmp_read().
|
static |
Definition at line 2690 of file exif.cc.
References history_entry_t::blendop_params, history_entry_t::blendop_params_len, history_entry_t::blendop_version, dt_exif_xmp_decode(), dt_free, history_entry_t::enabled, free_history_entry(), history_entry_t::have_modversion, history_entry_t::have_operation, history_entry_t::have_params, history_entry_t::iop_order, key, history_entry_t::modversion, history_entry_t::multi_name, history_entry_t::multi_priority, n, history_entry_t::num, history_entry_t::operation, history_entry_t::params, history_entry_t::params_len, and TRUE.
Referenced by dt_exif_xmp_read().
|
static |
Definition at line 2843 of file exif.cc.
References dt_exif_xmp_decode(), free_mask_entry(), i, mask_entry_t::mask_id, mask_id, mask_entry_t::mask_name, mask_name, mask_entry_t::mask_nb, mask_entry_t::mask_points, mask_entry_t::mask_points_len, mask_entry_t::mask_src, mask_entry_t::mask_src_len, mask_entry_t::mask_type, mask_entry_t::mask_version, and mask_entry_t::version.
Referenced by dt_exif_xmp_read().
|
static |
Definition at line 2909 of file exif.cc.
References dt_exif_xmp_decode(), dt_free, free_mask_entry(), key, mask_entry_t::mask_id, mask_entry_t::mask_name, mask_entry_t::mask_nb, mask_entry_t::mask_num, mask_entry_t::mask_points, mask_entry_t::mask_points_len, mask_entry_t::mask_src, mask_entry_t::mask_src_len, mask_entry_t::mask_type, mask_entry_t::mask_version, n, and mask_entry_t::version.
Referenced by dt_exif_xmp_read().
|
static |
Definition at line 3684 of file exif.cc.
References _convert_unix_to_gtimespan(), dt_image_t::change_timestamp, dt_image_t::export_timestamp, and dt_image_t::print_timestamp.
Referenced by dt_exif_xmp_read().
|
static |
Definition at line 3634 of file exif.cc.
References darktable, darktable_t::db, dt_database_get(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and dt_remove_xmp_keys().
Referenced by _exif_xmp_read_data().
| const char* dt_xmp_keys[] |
Definition at line 399 of file exif.cc.
Referenced by dt_remove_known_keys().
|
static |
Definition at line 417 of file exif.cc.
Referenced by dt_remove_known_keys().
|
static |
Definition at line 143 of file exif.cc.
Referenced by _exif_get_exiv2_tag_type(), dt_exif_get_exiv2_taglist(), and dt_exif_set_exiv2_taglist().