diff options
Diffstat (limited to 'gdk-pixbuf/io-ras.c')
-rw-r--r-- | gdk-pixbuf/io-ras.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-ras.c b/gdk-pixbuf/io-ras.c index fba4b9900..40ba370d5 100644 --- a/gdk-pixbuf/io-ras.c +++ b/gdk-pixbuf/io-ras.c @@ -68,6 +68,7 @@ struct rasterfile { /* Progressive loading */ struct ras_progressive_state { + GdkPixbufModuleSizeFunc size_func; GdkPixbufModulePreparedFunc prepared_func; GdkPixbufModuleUpdatedFunc updated_func; gpointer user_data; @@ -174,6 +175,15 @@ static gboolean RAS2State(struct rasterfile *RAS, if (!State->pixbuf) { + if (State->size_func) { + gint width = State->Header.width; + gint height = State->Header.height; + + (*State->size_func) (&width, &height, State->user_data); + if (width == 0 || height == 0) + return FALSE; + } + if (State->RasType == 32) State->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, (gint) State->Header.width, @@ -227,6 +237,7 @@ gdk_pixbuf__ras_image_begin_load(GdkPixbufModuleSizeFunc size_func, struct ras_progressive_state *context; context = g_new0(struct ras_progressive_state, 1); + context->size_func = size_func; context->prepared_func = prepared_func; context->updated_func = updated_func; context->user_data = user_data; |