diff --git a/src/common/mipmap_cache.c b/src/common/mipmap_cache.c index 4a445e3c15fb..58c282d5cef3 100644 --- a/src/common/mipmap_cache.c +++ b/src/common/mipmap_cache.c @@ -1464,7 +1464,7 @@ static void _init_8(uint8_t *buf, uint8_t *tmp = 0; int32_t thumb_width, thumb_height; res = dt_imageio_large_thumbnail(filename, &tmp, &thumb_width, &thumb_height, color_space); - if(!res) + if(res) { // if the thumbnail is not large enough, we compute one const dt_image_t *img2 = dt_image_cache_get(darktable.image_cache, imgid, 'r'); @@ -1528,10 +1528,11 @@ static void _init_8(uint8_t *buf, // export with flags: ignore exif(don't load from disk), don't // swap byte order, don't do hq processing, no upscaling and // signal we want thumbnail export - res = dt_imageio_export_with_flags(imgid, "unused", &format, (dt_imageio_module_data_t *)&dat, TRUE, FALSE, FALSE, - FALSE, FALSE, TRUE, NULL, FALSE, FALSE, DT_COLORSPACE_NONE, NULL, DT_INTENT_LAST, NULL, - NULL, 1, 1, NULL, -1); - if(!res) + res = dt_imageio_export_with_flags + (imgid, "unused", &format, (dt_imageio_module_data_t *)&dat, TRUE, FALSE, FALSE, + FALSE, FALSE, TRUE, NULL, FALSE, FALSE, DT_COLORSPACE_NONE, NULL, DT_INTENT_LAST, + NULL, NULL, 1, 1, NULL, -1); + if(res) { dt_print(DT_DEBUG_CACHE, "[mipmap_cache] generate mip %d for ID=%d from scratch\n", @@ -1548,7 +1549,7 @@ static void _init_8(uint8_t *buf, // dat.head.width, dat.head.height); // any errors? - if(res) + if(!res) { // dt_print(DT_DEBUG_ALWAYS, "[mipmap_cache] could not process thumbnail!\n"); *width = *height = 0; diff --git a/src/dtgtk/thumbnail.c b/src/dtgtk/thumbnail.c index 0beef73129af..254ef9f6ae5f 100644 --- a/src/dtgtk/thumbnail.c +++ b/src/dtgtk/thumbnail.c @@ -795,9 +795,9 @@ static gboolean _event_image_draw(GtkWidget *widget, char path[PATH_MAX] = { 0 }; gboolean from_cache = TRUE; dt_image_full_path(thumb->imgid, path, sizeof(path), &from_cache); - if(!dt_imageio_large_thumbnail(path, &full_res_thumb, - &full_res_thumb_wd, &full_res_thumb_ht, - &color_space)) + if(dt_imageio_large_thumbnail(path, &full_res_thumb, + &full_res_thumb_wd, &full_res_thumb_ht, + &color_space)) { // we look for focus areas dt_focus_cluster_t full_res_focus[49]; diff --git a/src/imageio/imageio.c b/src/imageio/imageio.c index 4b1b725ed482..ebd15435e231 100644 --- a/src/imageio/imageio.c +++ b/src/imageio/imageio.c @@ -153,7 +153,7 @@ gboolean dt_imageio_large_thumbnail(const char *filename, int32_t *height, dt_colorspaces_color_profile_type_t *color_space) { - int res = TRUE; + int res = FALSE; uint8_t *buf = NULL; char *mime_type = NULL; @@ -185,7 +185,7 @@ gboolean dt_imageio_large_thumbnail(const char *filename, goto error; } - res = FALSE; + res = TRUE; } else { @@ -236,13 +236,13 @@ gboolean dt_imageio_large_thumbnail(const char *filename, } } - res = FALSE; + res = TRUE; error_gm: if(image) DestroyImage(image); if(image_info) DestroyImageInfo(image_info); DestroyExceptionInfo(&exception); - if(res) goto error; + if(!res) goto error; #elif defined HAVE_IMAGEMAGICK MagickWand *image = NULL; MagickBooleanType mret; @@ -287,11 +287,11 @@ gboolean dt_imageio_large_thumbnail(const char *filename, goto error_im; } - res = FALSE; + res = TRUE; error_im: DestroyMagickWand(image); - if(res) goto error; + if(!res) goto error; #else dt_print(DT_DEBUG_ALWAYS, "[dt_imageio_large_thumbnail] error: The thumbnail image is not in " @@ -301,7 +301,7 @@ gboolean dt_imageio_large_thumbnail(const char *filename, #endif } - if(res) + if(!res) { dt_print(DT_DEBUG_ALWAYS, "[dt_imageio_large_thumbnail] error: Not a supported thumbnail " @@ -706,9 +706,9 @@ gboolean dt_imageio_export(const dt_imgid_t imgid, { if(strcmp(format->mime(format_params), "x-copy") == 0) /* This is a just a copy, skip process and just export */ - return (format->write_image(format_params, filename, NULL, icc_type, + return format->write_image(format_params, filename, NULL, icc_type, icc_filename, NULL, 0, imgid, num, total, NULL, - export_masks)) != 0; + export_masks); else { const gboolean is_scaling =