Compare commits

...

4 Commits

2 changed files with 20 additions and 6 deletions

View File

@ -3039,7 +3039,8 @@ open_libtiff(
// We inform about unsupported directories, but do not fail on them.
GError *err = NULL;
if (!try_append_page(
load_libtiff_directory(tiff, &err), &result, &result_tail)) {
load_libtiff_directory(tiff, &err), &result, &result_tail) &&
err) {
add_warning(ctx, "%s", err->message);
g_error_free(err);
}
@ -3107,10 +3108,20 @@ open_gdkpixbuf(
gdk_pixbuf_get_bits_per_sample(pixbuf) == 8;
cairo_surface_t *surface = NULL;
if (custom_argb32)
if (custom_argb32) {
surface = load_gdkpixbuf_argb32_unpremultiplied(pixbuf);
else
surface = gdk_cairo_surface_create_from_pixbuf(pixbuf, 1, NULL);
} else {
// Don't depend on GDK being initialized, to speed up thumbnailing
// (calling gdk_cairo_surface_create_from_pixbuf() would).
cairo_surface_t *dummy =
cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
cairo_t *cr = cairo_create(dummy);
cairo_surface_destroy(dummy);
gdk_cairo_set_source_pixbuf(cr, pixbuf, 0, 0);
(void) cairo_pattern_get_surface(cairo_get_source(cr), &surface);
cairo_surface_reference(surface);
cairo_destroy(cr);
}
cairo_status_t surface_status = cairo_surface_status(surface);
if (surface_status != CAIRO_STATUS_SUCCESS) {
@ -3313,6 +3324,8 @@ fiv_io_open_from_data(
GError *err = NULL;
if ((surface = open_gdkpixbuf(data, len, ctx, &err))) {
g_clear_error(error);
} else if (!err) {
// Contrary to documentation, this is a possible outcome (libheif).
} else if (err->code == GDK_PIXBUF_ERROR_UNKNOWN_TYPE) {
g_error_free(err);
} else {

View File

@ -332,11 +332,12 @@ extract_libraw_unpack(libraw_data_t *iprc, int *flip, GError **error)
sorted[i]->tformat == LIBRAW_INTERNAL_THUMBNAIL_KODAK_THUMB)
i++;
if (i < count)
bool found = i != count;
if (found)
i = sorted[i] - iprc->thumbs_list.thumblist;
g_free(sorted);
if (i == count) {
if (!found) {
set_error(error, "no suitable thumbnails found");
return FALSE;
}