New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io-webp.c: update_func() shall be called for proper signal delivery. #73
Conversation
FYI, the following mingw webp patch for gdk-pixbuf seems to support incremental load with |
Hey, thanks a lot for working on this, please bear with me as I don't have a lot of availability for reviews during August. I will look into this once I am back from vacation in September. |
Okay, existing tests pass on the pipeline. Do you have a test case that would fail with the current implementation and passes with your fix? I rather have a regression test with these merges. |
My application is "mikutter" that use ruby-gdk_pixbuf2. |
As I noted in BestImageViewer/geeqie#1076 (comment) , geeqie assumes
I'm not sure what the GdkPixbuf APIs assume, but the attached patch (against mainline) seems to fix the geeqie issue. diff --git a/io-webp.c b/io-webp.c
index c67e0a9..de2f83a 100644
--- a/io-webp.c
+++ b/io-webp.c
@@ -143,6 +143,8 @@ stop_load (gpointer data, GError **error)
{
if (context->prepare_func)
context->prepare_func (pb, GDK_PIXBUF_ANIMATION (anim), context->user_data);
+ if (context->update_func)
+ context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
ret = TRUE;
}
@@ -174,6 +176,9 @@ stop_load (gpointer data, GError **error)
return FALSE;
}
+ if (context->prepare_func)
+ context->prepare_func (pb, NULL, context->user_data);
+
if (icc_data)
{
gdk_pixbuf_set_option (pb, "icc-profile", icc_data);
@@ -187,10 +192,8 @@ stop_load (gpointer data, GError **error)
context->buffer->len, &config);
if (status == VP8_STATUS_OK)
{
- if (context->prepare_func)
- context->prepare_func (pb, NULL, context->user_data);
-
- g_clear_object (&pb);
+ if (context->update_func)
+ context->update_func (pb, 0, 0, context->width, context->height, context->user_data);
ret = TRUE;
}
@@ -198,6 +201,8 @@ stop_load (gpointer data, GError **error)
g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED,
"WebP decoder failed with VP8 status code: %d", status);
}
+
+ g_clear_object (&pb);
}
if (context->buffer) Maybe we need proper tests per callback API definitions on each signal, like https://tmytokai.github.io/open-ed/activity/gtkmm/img/p19.htm for |
I've updated the branch per previous patch. |
I can confirm this patch fixes geeqie .webp images displaying issue. |
This test will detect the problem noted in aruiz#73.
I do some work for the Geeqie project, which has an interest in this patch. |
This test will detect the problem noted in #73.
Sorry it took a while, I rebased this and pushed it to mainline. Will be making a release soon. Thanks for working on this! |
After this commit 36b3df08 (after 0.2.1), GdkPixBuf
PixbufModuleUpdatedFunc
(i.e.context->update_func()
) is no longer called in eitherload_increment()
orstop_load()
.As GdkPixBuf manual pages say, GdkPixbufLoader uses
PixbufModulePreparedFunc
to emit the “area_prepared” signal and also usesPixbufModuleUpdatedFunc
to emit the “area_updated” signal:https://docs.gtk.org/gdk-pixbuf/callback.PixbufModulePreparedFunc.html
https://docs.gtk.org/gdk-pixbuf/callback.PixbufModuleUpdatedFunc.html
So if a rendering window is in the main thread and loading and decoding ops are in the background process, the main thread will never be notified completion of decoding in the background process and none will be rendered, unless “area_updated” signal is delivered.