32#include <glib/gi18n.h>
62 "SELECT im.id, im.group_id, "
63 "(SELECT COUNT(id) FROM main.images WHERE group_id=im.group_id), "
64 "(SELECT COUNT(imgid) FROM main.history WHERE imgid=c.imgid), "
65 "COALESCE((SELECT current_hash FROM main.history_hash WHERE imgid=im.id), -1), "
66 "COALESCE((SELECT mipmap_hash FROM main.history_hash WHERE imgid=im.id), -1), "
67 "im.film_id, im.version, im.width, im.height, im.orientation, "
69 "im.import_timestamp, im.change_timestamp, im.export_timestamp, im.print_timestamp, "
70 "im.exposure, im.exposure_bias, im.aperture, im.iso, im.focal_length, im.focus_distance, "
72 "im.longitude, im.latitude, im.altitude, "
73 "im.filename, fr.folder || '" G_DIR_SEPARATOR_S
"' || im.filename, "
74 "im.maker, im.model, im.lens, fr.folder, "
75 "COALESCE((SELECT SUM(1 << color) FROM main.color_labels WHERE imgid=im.id), 0), "
76 "im.crop, im.raw_parameters, im.color_matrix, im.colorspace, "
77 "im.raw_black, im.raw_maximum, im.aspect_ratio, im.output_width, im.output_height "
78 "FROM main.images AS im "
79 "JOIN memory.collected_images AS c ON im.id = c.imgid "
80 "LEFT JOIN main.film_rolls AS fr ON fr.id = im.film_id "
81 "ORDER BY c.rowid ASC",
102 return (isnan(a) && isnan(b)) || a == b;
107 return (isnan(a) && isnan(b)) || a == b;
121 g_assert_cmpint(sql_info->
id, ==, cache_info.
id);
127 g_assert_cmpint(sql_info->
width, ==, cache_info.
width);
128 g_assert_cmpint(sql_info->
height, ==, cache_info.
height);
132 g_assert_cmpint(sql_info->
flags, ==, cache_info.
flags);
133 g_assert_cmpint(sql_info->
loader, ==, cache_info.
loader);
134 g_assert_cmpint(sql_info->
rating, ==, cache_info.
rating);
138 g_assert(sql_info->
is_bw == cache_info.
is_bw);
160 g_assert_cmpstr(sql_info->
folder, ==, cache_info.
folder);
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
sqlite3 * dt_database_get(const dt_database_t *db)
#define DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e)
void dt_image_cache_read_release(dt_image_cache_t *cache, const dt_image_t *img)
dt_image_t * dt_image_cache_get(dt_image_cache_t *cache, const int32_t imgid, char mode)
int dt_image_cache_seed(dt_image_cache_t *cache, const dt_image_t *img)
const struct dt_database_t * db
struct dt_image_cache_t * image_cache
GTimeSpan export_timestamp
float exif_focus_distance
GTimeSpan import_timestamp
char camera_makermodel[128]
dt_image_orientation_t orientation
GTimeSpan change_timestamp
char local_copy_path[PATH_MAX]
GTimeSpan print_timestamp
GTimeSpan exif_datetime_taken
char filename[DT_MAX_FILENAME_LEN]
char local_copy_legacy_path[PATH_MAX]
void dt_thumbtable_copy_image(dt_image_t *info, const dt_image_t *const img)
static sqlite3_stmt * _thumbtable_collection_stmt
void dt_thumbtable_info_cleanup(void)
static gboolean _thumbtable_double_equal(const double a, const double b)
void dt_thumbtable_info_debug_assert_matches_cache(const dt_image_t *sql_info)
void dt_thumbtable_info_seed_image_cache(const dt_image_t *info)
static gboolean _thumbtable_float_equal(const float a, const float b)
sqlite3_stmt * dt_thumbtable_info_get_collection_stmt(void)