Fix #1076: webp images show up as black
[geeqie.git] / subprojects / packagefiles / webp-pixbuf-loader / pull-73.diff
1 diff --git a/io-webp.c b/io-webp.c
2 index c67e0a9..de2f83a 100644
3 --- a/io-webp.c
4 +++ b/io-webp.c
5 @@ -143,6 +143,8 @@ stop_load (gpointer data, GError **error)
6          {
7            if (context->prepare_func)
8              context->prepare_func (pb, GDK_PIXBUF_ANIMATION (anim), context->user_data);
9 +          if (context->update_func)
10 +            context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
11            ret = TRUE;
12          }
13  
14 @@ -174,6 +176,9 @@ stop_load (gpointer data, GError **error)
15            return FALSE;
16          }
17  
18 +      if (context->prepare_func)
19 +        context->prepare_func (pb, NULL, context->user_data);
20 +
21        if (icc_data)
22          {
23            gdk_pixbuf_set_option (pb, "icc-profile", icc_data);
24 @@ -187,10 +192,8 @@ stop_load (gpointer data, GError **error)
25                                           context->buffer->len, &config);
26        if (status == VP8_STATUS_OK)
27          {
28 -          if (context->prepare_func)
29 -            context->prepare_func (pb, NULL, context->user_data);
30 -
31 -          g_clear_object (&pb);
32 +          if (context->update_func)
33 +            context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
34  
35            ret = TRUE;
36          }
37 @@ -198,6 +201,8 @@ stop_load (gpointer data, GError **error)
38          g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED,
39                            "WebP decoder failed with VP8 status code: %d", status);
40        }
41 +
42 +      g_clear_object (&pb);
43      }
44  
45    if (context->buffer)