75 ctx->counter,
ctx->image_count, 100.0 *
ctx->counter / (
float)
ctx->image_count, imgid,
78 for(
int k =
ctx->max_mip;
k >=
ctx->min_mip &&
k >= 0;
k--)
108 fprintf(
stderr,
_(
"could not create directory '%s'!\n"), dirname);
115 if(counted < 0)
return 1;
116 size_t image_count = (size_t)counted;
120 fprintf(
stderr,
_(
"warning: no images are matching the requested image id range\n"));
123 fprintf(
stderr,
_(
"warning: did you want to swap these boundaries?\n"));
129 .min_mip = min_mip, .max_mip = max_mip };
137static void usage(
const char *progname)
140 "usage: %s [-h, --help; --version]\n"
141 " [--min-mip <0-8> (default = 0)] [-m, --max-mip <0-8> (default = 2)]\n"
142 " [--min-imgid <N>] [--max-imgid <N>]\n"
143 " [--core <darktable options>]\n"
145 "When multiple mipmap sizes are requested, the biggest one is computed\n"
146 "while the rest are quickly downsampled.\n"
148 "The --min-imgid and --max-imgid specify the range of internal image ID\n"
149 "numbers to work on.\n",
186 printf(
"this is ansel-generate-cache %s\ncopyright (c) 2014 johannes hanika; 2015 LebedevRI\n",
235 fprintf(
stderr,
_(
"warning: disk backend for thumbnail cache is disabled (cache_disk_backend)\nif you want "
236 "to pre-generate thumbnails and for Ansel to use them, you need to enable disk backend "
237 "for thumbnail cache\nno thumbnails to be generated, done.\n"));
243 if(min_mip > max_mip)
250 fprintf(
stderr,
_(
"creating complete lighttable thumbnail cache\n"));
static void usage(const char *progname)
static void _generate_one(const int32_t imgid, const char *imgfilename, void *user_data)
static int generate_thumbnail_cache(const dt_mipmap_size_t min_mip, const dt_mipmap_size_t max_mip, const int32_t min_imgid, const int32_t max_imgid)
int dt_conf_get_bool(const char *name)
const char darktable_package_version[]
int dt_init(int argc, char *argv[], const gboolean init_gui, const gboolean load_data)
void dt_loc_get_localedir(char *localedir, size_t bufsize)
void dt_loc_init(const char *datadir, const char *moduledir, const char *localedir, const char *configdir, const char *cachedir, const char *tmpdir, const char *kerneldir)
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.
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.
Reading and writing one dt_image_t to and from the library database. The SQL half of what used to be ...
float *const restrict const size_t k
void dt_mipmap_get_cache_filename(char path[PATH_MAX], dt_mipmap_size_t mip, const int32_t imgid)
void dt_mimap_cache_evict(const int32_t imgid)
void dt_mipmap_get_cache_dir(char path[PATH_MAX], dt_mipmap_size_t mip)
#define dt_mipmap_cache_get(B, C, D, E, F)
#define dt_mipmap_cache_release(B)
void dt_osx_prepare_environment()
gboolean dt_util_test_image_file(const char *filename)