65 "SELECT i.id, i.group_id, "
66 " (SELECT COUNT(id) FROM main.images WHERE group_id = i.group_id), "
67 " (SELECT COUNT(imgid) FROM main.history WHERE imgid = i.id), "
68 " COALESCE((SELECT current_hash FROM main.history_hash WHERE imgid = i.id), -1), "
69 " COALESCE((SELECT mipmap_hash FROM main.history_hash WHERE imgid = i.id), -1), "
70 " i.film_id, i.version, i.width, i.height, i.orientation, i.flags, "
71 " i.import_timestamp, i.change_timestamp, i.export_timestamp, i.print_timestamp, "
72 " i.exposure, i.exposure_bias, i.aperture, i.iso, i.focal_length, i.focus_distance, "
73 " i.datetime_taken, i.longitude, i.latitude, i.altitude, "
75 " i.maker, i.model, i.lens, f.folder, "
76 " COALESCE((SELECT SUM(1 << color) FROM main.color_labels WHERE imgid=i.id), 0), "
77 " i.crop, i.raw_parameters, i.color_matrix, i.colorspace, "
78 " i.raw_black, i.raw_maximum, i.aspect_ratio, i.output_width, i.output_height"
79 " FROM main.images AS i"
80 " LEFT JOIN main.film_rolls AS f ON f.id = i.film_id"
199 "INSERT INTO main.history_hash (imgid, current_hash, basic_hash, auto_hash, mipmap_hash)"
200 " VALUES (?1, ?2, NULL, NULL, ?3)"
201 " ON CONFLICT (imgid)"
202 " DO UPDATE SET current_hash = ?2, basic_hash = NULL, auto_hash = NULL, mipmap_hash = ?3",
221 gboolean found =
FALSE;
237 fprintf(
stderr,
"[image_repository_load] failed to open image %" PRId32 " from database: %s\n", imgid,
255 "SELECT i.id, i.group_id, "
256 " (SELECT COUNT(id) FROM main.images WHERE group_id = i.group_id), "
257 " (SELECT COUNT(imgid) FROM main.history WHERE imgid = i.id), "
258 " COALESCE((SELECT current_hash FROM main.history_hash WHERE imgid = i.id), -1), "
259 " COALESCE((SELECT mipmap_hash FROM main.history_hash WHERE imgid = i.id), -1), "
260 " i.film_id, i.version, i.width, i.height, i.orientation, i.flags, "
261 " i.import_timestamp, i.change_timestamp, i.export_timestamp, i.print_timestamp, "
262 " i.exposure, i.exposure_bias, i.aperture, i.iso, i.focal_length, i.focus_distance, "
263 " i.datetime_taken, i.longitude, i.latitude, i.altitude, "
265 " i.maker, i.model, i.lens, f.folder, "
266 " COALESCE((SELECT SUM(1 << color) FROM main.color_labels WHERE imgid=i.id), 0), "
267 " i.crop, i.raw_parameters, i.color_matrix, i.colorspace, "
268 " i.raw_black, i.raw_maximum, i.aspect_ratio, i.output_width, i.output_height"
269 " FROM main.images AS i"
270 " JOIN memory.collected_images AS c ON i.id = c.imgid"
271 " LEFT JOIN main.film_rolls AS f ON f.id = i.film_id"
272 " ORDER BY c.rowid ASC",
284 cb(user_data, &info);
303 " SET width = ?1, height = ?2, filename = ?3, maker = ?4, model = ?5,"
304 " lens = ?6, exposure = ?7, aperture = ?8, iso = ?9, focal_length = ?10,"
305 " focus_distance = ?11, film_id = ?12, datetime_taken = ?13, flags = ?14,"
306 " crop = ?15, orientation = ?16, raw_parameters = ?17, group_id = ?18,"
307 " longitude = ?19, latitude = ?20, altitude = ?21, color_matrix = ?22,"
308 " colorspace = ?23, raw_black = ?24, raw_maximum = ?25,"
309 " aspect_ratio = ROUND(?26,1), exposure_bias = ?27,"
310 " import_timestamp = ?28, change_timestamp = ?29, export_timestamp = ?30,"
311 " print_timestamp = ?31, output_width = ?32, output_height = ?33"
394 "SELECT id FROM main.images WHERE group_id = ?1", -1, &
stmt,
NULL);
413 "SELECT id, version, filename"
415 " WHERE group_id = ?1", -1, &
stmt,
442 "SELECT COUNT(*) FROM main.images WHERE id >= ?1 AND id <= ?2", -1,
462 "SELECT id, filename FROM main.images WHERE id >= ?1 AND id <= ?2", -1,
480 "UPDATE main.images SET group_id = ?1 WHERE group_id = ?2 AND id != ?3",
498 "SELECT flags FROM main.images WHERE id IN "
499 "(SELECT imgid FROM main.selected_images)",
507 "SELECT flags FROM main.images WHERE id = ?1", -1, &
stmt,
NULL);
534 "SELECT id FROM main.images WHERE film_id = ?1 AND filename = ?2",
552 " FROM main.images, main.film_rolls"
553 " WHERE film_rolls.folder = ?1"
554 " AND images.film_id = film_rolls.id"
555 " AND images.filename = ?2",
589 "UPDATE main.images SET version=?1, max_version = ?1 WHERE id = ?2", -1, &
stmt,
NULL);
606 " WHERE id!=?1 AND flags&?2=?2"
607 " AND film_id=(SELECT film_id"
610 " AND filename=(SELECT filename"
647 char *
query =
g_strdup_printf(
"SELECT id FROM main.images WHERE id IN (%s) AND flags&?1=?1", set);
664 char *
query =
g_strdup_printf(
"UPDATE main.images SET flags = (flags|?1) WHERE id IN (%s)", set);
680 char *
query =
g_strdup_printf(
"UPDATE main.images SET flags = (flags & ~?1) WHERE id IN (%s)", set);
699 "main.images i, main.film_rolls f "
700 "ON i.film_id = f.id WHERE i.id IN (%s)", set);
730 if(imgid <= 0)
return FALSE;
737 "UPDATE main.images SET flags = ?1 WHERE id = ?2",
758 if(imgid <= 0 || mask == 0)
return FALSE;
768 "UPDATE main.images SET flags = (flags & ~?1) | (?2 & ?1)"
796 "SELECT i.id, write_timestamp, version,"
798 " FROM main.images i, main.film_rolls f"
799 " ON i.film_id = f.id"
800 " ORDER BY f.id, filename",
827 "COUNT(DISTINCT film_id), "
829 "COUNT(DISTINCT group_id), "
830 "COUNT(DISTINCT filename), "
831 "COUNT(DISTINCT version), "
832 "COUNT(DISTINCT film_id || '/' || filename), "
833 "COUNT(DISTINCT flags & 2048), "
834 "COUNT(DISTINCT import_timestamp), "
835 "COUNT(DISTINCT change_timestamp), "
836 "COUNT(DISTINCT export_timestamp), "
837 "COUNT(DISTINCT print_timestamp), "
838 "COUNT(DISTINCT flags), "
839 "COUNT(DISTINCT model), "
840 "COUNT(DISTINCT maker), "
841 "COUNT(DISTINCT lens), "
842 "COUNT(DISTINCT aperture), "
843 "COUNT(DISTINCT exposure), "
844 "COUNT(DISTINCT IFNULL(exposure_bias, '')), "
845 "COUNT(DISTINCT focal_length), "
846 "COUNT(DISTINCT focus_distance), "
847 "COUNT(DISTINCT iso), "
848 "COUNT(DISTINCT datetime_taken), "
849 "COUNT(DISTINCT width), "
850 "COUNT(DISTINCT height), "
851 "COUNT(DISTINCT IFNULL(output_width, '')), "
852 "COUNT(DISTINCT IFNULL(output_height, '')), "
853 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 2 WHERE images.id in (%s)), "
854 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 3 WHERE images.id in (%s)), "
855 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 0 WHERE images.id in (%s)), "
856 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 1 WHERE images.id in (%s)), "
857 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 4 WHERE images.id in (%s)), "
858 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 5 WHERE images.id in (%s)), "
859 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 6 WHERE images.id in (%s)), "
860 "(SELECT COUNT(DISTINCT IFNULL(value,'')) FROM images LEFT JOIN meta_data ON meta_data.id = images.id AND key = 7 WHERE images.id in (%s)), "
861 "COUNT(DISTINCT IFNULL(latitude, '')), "
862 "COUNT(DISTINCT IFNULL(longitude, '')), "
863 "COUNT(DISTINCT IFNULL(altitude, '')) "
866 set, set, set, set, set, set, set, set, set);
904 "SELECT MIN(latitude), MAX(latitude),"
905 " MIN(longitude), MAX(longitude), COUNT(*)"
906 " FROM main.images AS i "
907 " JOIN memory.collected_images AS l ON l.imgid = i.id "
908 " WHERE latitude NOT NULL AND longitude NOT NULL",
928 const double lat1,
const double lat2,
938 " (SELECT i.id, i.longitude, i.latitude "
939 " FROM main.images i INNER JOIN memory.collected_images c ON i.id = c.imgid"
940 " WHERE longitude >= ?1 AND longitude <= ?2"
941 " AND latitude <= ?3 AND latitude >= ?4 "
942 " AND longitude NOT NULL AND latitude NOT NULL)"
943 " ORDER BY longitude ASC",
965 *count = (int)points->len;
977 if(imgid <= 0)
return 0;
984 "SELECT write_timestamp FROM main.images WHERE id = ?1",
1006 if(imgid <= 0)
return;
1014 "UPDATE main.images SET write_timestamp = STRFTIME('%s', 'now') WHERE id = ?1",
1029 if(imgid <= 0)
return FALSE;
1033 "UPDATE main.images SET write_timestamp = ?2 WHERE id = ?1",
1059 "DELETE FROM main.meta_data WHERE id = ?1", -1, &
stmt,
NULL);
1075 " FROM main.images AS a JOIN main.images AS b"
1076 " WHERE a.film_id = b.film_id AND a.filename = b.filename"
1077 " AND b.id = ?1 AND a.version = ?2"
1078 " ORDER BY a.id DESC",
1095 "INSERT INTO main.images"
1096 " (id, group_id, film_id, width, height, filename, maker, model, lens, exposure,"
1097 " aperture, iso, focal_length, focus_distance, datetime_taken, flags,"
1098 " output_width, output_height, crop, raw_parameters, raw_denoise_threshold,"
1099 " raw_auto_bright_threshold, raw_black, raw_maximum,"
1100 " license, sha1sum, orientation, histogram, lightmap,"
1101 " longitude, latitude, altitude, color_matrix, colorspace, version, max_version, history_end,"
1102 " aspect_ratio, exposure_bias, import_timestamp)"
1103 " SELECT NULL, group_id, film_id, width, height, filename, maker, model, lens,"
1104 " exposure, aperture, iso, focal_length, focus_distance, datetime_taken,"
1105 " flags, output_width, output_height, crop, raw_parameters, raw_denoise_threshold,"
1106 " raw_auto_bright_threshold, raw_black, raw_maximum,"
1107 " license, sha1sum, orientation, histogram, lightmap,"
1108 " longitude, latitude, altitude, color_matrix, colorspace, NULL, NULL, 0,"
1109 " aspect_ratio, exposure_bias, import_timestamp"
1110 " FROM main.images WHERE id = ?1",
1118 "SELECT a.id, a.film_id, a.filename, b.max_version"
1119 " FROM main.images AS a JOIN main.images AS b"
1120 " WHERE a.film_id = b.film_id AND a.filename = b.filename AND b.id = ?1"
1121 " ORDER BY a.id DESC",
1128 gchar *filename =
NULL;
1142 "INSERT INTO main.color_labels (imgid, color)"
1143 " SELECT ?1, color FROM main.color_labels WHERE imgid = ?2",
1153 "INSERT INTO main.meta_data (id, key, value)"
1154 " SELECT ?1, key, value FROM main.meta_data WHERE id = ?2",
1164 "INSERT INTO main.tagged_images (imgid, tagid, position)"
1165 " SELECT ?1, tagid, "
1166 " (SELECT (IFNULL(MAX(position),0) & 0xFFFFFFFF00000000)"
1167 " FROM main.tagged_images)"
1168 " + (ROW_NUMBER() OVER (ORDER BY imgid) << 32)"
1169 " FROM main.tagged_images AS ti"
1170 " WHERE imgid = ?2",
1180 "INSERT INTO main.module_order (imgid, iop_list, version)"
1181 " SELECT ?1, iop_list, version FROM main.module_order WHERE imgid = ?2",
1203 "UPDATE main.images SET max_version=?1 WHERE film_id = ?2 AND filename = ?3", -1,
1233 "SELECT i.version, i.id, m.value"
1235 " LEFT JOIN meta_data AS m ON m.id = i.id AND m.key = ?3"
1236 " WHERE film_id = ?1 AND filename = ?2"
1237 " ORDER BY i.version",
1272 " WHERE filename IN (SELECT filename FROM main.images WHERE id = ?1)"
1273 " AND film_id IN (SELECT film_id FROM main.images WHERE id = ?1)",
1291 gchar *filename =
NULL;
1298 "INSERT INTO main.images"
1299 " (id, group_id, film_id, width, height, filename, maker, model, lens, exposure,"
1300 " aperture, iso, focal_length, focus_distance, datetime_taken, flags,"
1301 " output_width, output_height, crop, raw_parameters, raw_denoise_threshold,"
1302 " raw_auto_bright_threshold, raw_black, raw_maximum,"
1303 " license, sha1sum, orientation, histogram, lightmap,"
1304 " longitude, latitude, altitude, color_matrix, colorspace, version, max_version,"
1305 " aspect_ratio, exposure_bias)"
1306 " SELECT NULL, group_id, ?1 as film_id, width, height, ?2 as filename, maker, model, lens,"
1307 " exposure, aperture, iso, focal_length, focus_distance, datetime_taken,"
1308 " flags, width, height, crop, raw_parameters, raw_denoise_threshold,"
1309 " raw_auto_bright_threshold, raw_black, raw_maximum,"
1310 " license, sha1sum, orientation, histogram, lightmap,"
1311 " longitude, latitude, altitude, color_matrix, colorspace, -1, -1,"
1312 " aspect_ratio, exposure_bias"
1325 "SELECT a.id, a.filename"
1326 " FROM main.images AS a"
1327 " JOIN main.images AS b"
1328 " WHERE a.film_id = ?1 AND a.filename = ?2 AND b.filename = ?3 AND b.id = ?4"
1329 " ORDER BY a.id DESC",
1348 "INSERT INTO main.color_labels (imgid, color)"
1350 " FROM main.color_labels"
1351 " WHERE imgid = ?2",
1360 "INSERT INTO main.meta_data (id, key, value)"
1361 " SELECT ?1, key, value"
1362 " FROM main.meta_data"
1373 "INSERT INTO main.tagged_images (imgid, tagid, position)"
1374 " SELECT ?1, tagid, "
1375 " (SELECT (IFNULL(MAX(position),0) & 0xFFFFFFFF00000000)"
1376 " FROM main.tagged_images)"
1377 " + (ROW_NUMBER() OVER (ORDER BY imgid) << 32)"
1378 " FROM main.tagged_images AS ti"
1379 " WHERE imgid = ?2",
1392 "SELECT MAX(a.max_version)"
1393 " FROM main.images AS a"
1394 " JOIN main.images AS b"
1395 " WHERE a.film_id = b.film_id AND a.filename = b.filename AND b.id = ?1",
1410 "UPDATE main.images SET version=?1 WHERE id = ?2", -1, &
stmt,
NULL);
1418 "UPDATE main.images SET max_version=?1 WHERE film_id = ?2 AND filename = ?3",
1432 "SELECT DISTINCT a.group_id"
1433 " FROM main.images AS a"
1434 " JOIN main.images AS b"
1435 " WHERE a.film_id = b.film_id AND a.filename = b.filename"
1436 " AND b.id = ?1 AND a.id != ?1",
1454 "UPDATE main.images SET group_id=?1 WHERE id = ?2", -1, &
stmt,
NULL);
1468 const int flags,
const int64_t import_timestamp)
1475 "INSERT INTO main.images (id, film_id, filename, license, sha1sum, flags, version, "
1476 " max_version, history_end, position, import_timestamp)"
1477 " SELECT NULL, ?1, ?2, '', '', ?3, 0, 0, 0, (IFNULL(MAX(position),0) & 0xFFFFFFFF00000000) + (1 << 32), ?4 "
1498 int32_t group_id = -1;
1508 " WHERE film_id = ?1 AND filename LIKE ?2 AND id = group_id", -1, &
stmt,
1521 " WHERE film_id = ?1 AND filename LIKE ?2 AND id != ?3", -1, &
stmt,
NULL);
1538 "UPDATE main.images SET group_id = ?1 WHERE id = ?2",
1552 gboolean found =
FALSE;
1556 "SELECT filename, flags, raw_parameters, "
1557 " longitude, latitude, altitude, history_end, datetime_taken"
1604 memset(ts, 0,
sizeof(*ts));
1606 gboolean found =
FALSE;
1611 "SELECT import_timestamp, change_timestamp, export_timestamp, print_timestamp"
void dt_colorlabel_repository_remove(const int32_t imgid, const int color)
Clear colour color on imgid. Clearing one that is not set does nothing.
void dt_colorlabel_repository_set(const int32_t imgid, const int color)
Set colour color on imgid. Setting one that is already set does nothing.
main.color_labels: which of the five colour labels are set on an image.
void dt_image_init(dt_image_t *img)
const char * dt_image_film_roll_name(const char *path)
void dt_image_set_provisional_dsc(dt_image_t *img)
void dt_image_local_copy_paths_from_fullpath(const char *fullpath, int32_t imgid, char *local_copy_path, size_t local_copy_len, char *local_copy_legacy_path, size_t local_copy_legacy_len)
sqlite3 * dt_database_get_sqlite3_global(void)
gboolean dt_datetime_gtimespan_to_local(char *local, const size_t local_size, const GTimeSpan gts, const gboolean msec, const gboolean tz)
GtkWidget * folder
destination folder chooser
static int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mutex) NO_THREAD_SAFETY_ANALYSIS
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
static int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex)
static int dt_pthread_mutex_lock(dt_pthread_mutex_t *mutex) ACQUIRE(mutex) NO_THREAD_SAFETY_ANALYSIS
int dt_image_repository_get_version(const int32_t imgid)
The duplicate version number of imgid, or 0.
void dt_image_repository_touch_write_timestamp(const int32_t imgid)
Set write_timestamp of imgid to now.
static void _image_write_history_hash(const dt_image_t *img)
static gsize _image_stmt_mutex_inited
static sqlite3_stmt * _image_write_timestamp_update_stmt
int dt_image_repository_count_others_with_flag(const int32_t imgid, const int flag)
How many OTHER images share this image's film roll and filename and carry flag.
int dt_image_repository_count_in_id_range(const int32_t min_imgid, const int32_t max_imgid)
How many images have an id in [min_imgid, max_imgid]. -1 when unreadable.
gboolean dt_image_repository_set_flags_masked(const int32_t imgid, const int mask, const int value)
Write only mask's bits of imgid's flags, taking them from value.
GList * dt_image_repository_get_ids_with_flag_among(GList *imgids, const int flag)
Of the images in imgids, those whose flags carry flag, in row order.
void dt_image_repository_cleanup(void)
Finalise the prepared statements. Called at shutdown, after the last cache release and before the dat...
static char * _id_set(GList *imgids)
void dt_image_repository_xmp_row_cleanup(dt_image_xmp_row_t *row)
Release what dt_image_repository_get_xmp_row() allocated.
int64_t dt_image_repository_get_write_timestamp(const int32_t imgid)
main.images.write_timestamp for imgid, or 0.
gboolean dt_image_repository_set_group(const int32_t imgid, const int32_t group_id)
Set imgid's group_id.
static sqlite3_stmt * _image_write_timestamp_select_stmt
gboolean dt_image_repository_set_write_timestamp(const int32_t imgid, const int64_t timestamp)
Set write_timestamp of imgid to timestamp (seconds since the epoch). Bound as a 64-bit integer; the c...
void dt_image_group_member_free(gpointer data)
Free one dt_image_group_member_t. Suits g_list_free_full().
gboolean dt_image_repository_get_collected_geo_bounds(dt_image_geo_bounds_t *bounds)
Bounding box of every collected image carrying coordinates.
void dt_image_repository_foreach_collected(dt_image_repository_collected_cb cb, void *user_data)
Every image of the current collection, in collection order, already mapped.
gboolean dt_image_repository_load(const int32_t imgid, dt_image_t *img)
Fill img from the main.images row for imgid.
static sqlite3_stmt * _image_set_flags_stmt
int32_t dt_image_repository_find_group_for_pattern(const int32_t film_id, const char *filename_pattern, const gboolean leader_only, const int32_t exclude_imgid)
The group leader of an existing image in film_id matching filename_pattern (a LIKE pattern),...
GList * dt_image_repository_get_group_member_rows(const int32_t group_id)
Every member of group_id, in row order, named. Free with g_list_free_full(list, dt_image_group_member...
gboolean dt_image_repository_get_timestamps(const int32_t imgid, dt_image_timestamps_t *ts)
Read imgid's four timestamps. FALSE when there is no such image.
gboolean dt_image_repository_delete(const int32_t imgid)
Delete imgid from main.images and main.meta_data.
int32_t dt_image_repository_copy_to_film(const int32_t imgid, const int32_t filmid, const char *new_filename, const char *old_filename)
Copy imgid into film roll filmid under new_filename, returning the new id.
GList * dt_image_repository_get_versions(const int32_t film_id, const char *filename, const int name_keyid)
Every version of the file (film_id, filename), in version order, each with the name stored under meta...
gboolean dt_image_repository_set_flags(const int32_t imgid, const int flags)
Replace imgid's whole flags word.
static sqlite3_stmt * _image_set_flags_masked_stmt
GList * dt_image_repository_get_duplicate_ids(const int32_t imgid)
Every image id sharing imgid's film roll and filename, itself included, in row order – an image and i...
static sqlite3_stmt * _image_load_stmt
GList * dt_image_repository_get_ids_with_flag(const int flag)
Every image id whose flags carry flag, in row order.
void dt_image_repository_foreach_in_id_range(const int32_t min_imgid, const int32_t max_imgid, dt_image_repository_id_filename_cb cb, void *user_data)
Walk the images whose id falls in [min_imgid, max_imgid], in row order.
gboolean dt_image_repository_get_xmp_row(const int32_t imgid, dt_image_xmp_row_t *row)
Read imgid's sidecar fields. FALSE when there is no such image.
gboolean dt_image_repository_clear_flag_among(GList *imgids, const int flag)
Clear flag on every image in imgids – the counterpart of dt_image_repository_set_flag_among(),...
static dt_pthread_mutex_t _image_stmt_mutex
void dt_image_version_free(gpointer data)
Release one dt_image_version_t. Use with g_list_free_full().
void dt_image_repository_reassign_group(const int32_t from_group_id, const int32_t to_group_id, const int32_t exclude_imgid)
Move every member of from_group_id into to_group_id, except exclude_imgid.
int32_t dt_image_repository_duplicate(const int32_t imgid, const int32_t newversion)
Duplicate imgid as a new version, returning the new image id (-1 on failure).
static void dt_image_from_stmt(dt_image_t *img, sqlite3_stmt *stmt)
static void _image_stmt_mutex_ensure(void)
void dt_image_repository_store(const dt_image_t *img)
Write img back to main.images, plus its colour labels and history hash.
int32_t dt_image_repository_find_by_film_and_filename(const int32_t film_id, const char *filename)
The image id for filename inside film roll film_id, or -1.
static sqlite3_stmt * _image_get_stmt(void)
GList * dt_image_repository_get_ratings(const int32_t imgid)
Star ratings, as main.images.flags encodes them: the low three bits, minus one.
dt_image_geo_point_t * dt_image_repository_get_collected_geo_points(const double lon1, const double lon2, const double lat1, const double lat2, int *count)
Collected images inside the box, ordered by longitude ascending.
void dt_image_repository_foreach_with_path(dt_image_repository_path_row_cb cb, void *user_data)
Walk every image in the library, film roll by film roll, filename within each.
gboolean dt_image_repository_set_version(const int32_t imgid, const int version)
Set both version and max_version of imgid to version.
int32_t dt_image_repository_find_by_folder_and_filename(const char *folder, const char *filename)
The image id for a full path, split into its folder and filename, or -1.
gboolean dt_image_repository_set_flag_among(GList *imgids, const int flag)
Set flag on every image in imgids.
GList * dt_image_repository_get_group_members(const int32_t group_id, const int32_t exclude_imgid)
Image ids in group group_id.
GList * dt_image_repository_get_full_paths(GList *imgids)
"<folder>/<filename>" for every image in imgids, distinct, in row order. Caller owns the strings.
int * dt_image_repository_count_distinct_fields(GList *imgids)
How many DISTINCT values each dt_image_field_t takes over imgids.
static sqlite3_stmt * _image_write_history_hash_stmt
gboolean dt_image_repository_insert_import(const int32_t film_id, const char *filename, const int flags, const int64_t import_timestamp)
Insert a bare row for a file being imported, returning TRUE on success.
static GList * _collect_ids(sqlite3_stmt *stmt, const int32_t exclude_imgid)
Reading and writing one dt_image_t to and from the library database. The SQL half of what used to be ...
gboolean(* dt_image_repository_path_row_cb)(const int32_t imgid, const int64_t write_timestamp, const int version, const char *image_path, const int flags, void *user_data)
One row of dt_image_repository_foreach_with_path(). image_path is borrowed: it lives until the callba...
void(* dt_image_repository_id_filename_cb)(const int32_t imgid, const char *filename, void *user_data)
One row of dt_image_repository_foreach_in_id_range(). filename is borrowed.
void(* dt_image_repository_collected_cb)(void *user_data, const dt_image_t *info)
One image of the current collection. info is borrowed: it lives until the callback returns.
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
dt_mipmap_buffer_dsc_flags flags
static const dt_aligned_pixel_simd_t value
Checked wrappers around the sqlite3_* calls: trace the statement, assert the return code,...
#define DT_DEBUG_SQLITE3_BIND_BLOB(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_TEXT(a, b, c, d, e)
#define DT_DEBUG_SQLITE3_BIND_INT(a, b, c)
#define DT_DEBUG_SQLITE3_BIND_INT64(a, b, c)
#define DT_DEBUG_SQLITE3_BIND_DOUBLE(a, b, c)
const float const int flip
The extent of the collection's geotagged images.
One geotagged image, in degrees as stored.
One member of a group, with what a tooltip needs to name it.
GTimeSpan export_timestamp
float exif_focus_distance
GTimeSpan import_timestamp
char local_copy_path[DT_PATH_MAX]
dt_image_orientation_t orientation
GTimeSpan change_timestamp
GTimeSpan print_timestamp
GTimeSpan exif_datetime_taken
float d65_color_matrix[9]
char filmroll[DT_PATH_MAX]
dt_image_colorspace_t colorspace
char local_copy_legacy_path[DT_PATH_MAX]
dt_image_raw_parameters_t legacy_flip
char filename[DT_MAX_FILENAME_LEN]
char fullpath[DT_PATH_MAX]
The four timestamps, each with whether it is set at all.
One version of a file: which duplicate it is, its id, and the name the user gave it.
The main.images fields an XMP sidecar carries.