From dddf7c2b3ed2548029be8fa178794d814fe5ae03 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 25 Nov 2003 02:39:01 +0000 Subject: more fixes to the pixbuf loader. I can use it for thumbnailing nicely now Original commit message from CVS: more fixes to the pixbuf loader. I can use it for thumbnailing nicely now --- ext/gdk_pixbuf/gst_loader.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'ext/gdk_pixbuf/gst_loader.c') diff --git a/ext/gdk_pixbuf/gst_loader.c b/ext/gdk_pixbuf/gst_loader.c index aad4df2a..7a8af4ff 100644 --- a/ext/gdk_pixbuf/gst_loader.c +++ b/ext/gdk_pixbuf/gst_loader.c @@ -179,9 +179,34 @@ gst_loader_load_animation (FILE *f, GError **error) GST_LOG_OBJECT (ani, "load_animation succeeded"); return GDK_PIXBUF_ANIMATION (ani); } +static GdkPixbuf * +gst_loader_load (FILE *f, GError **error) +{ + GdkPixbufAnimation *ani; + GdkPixbuf *pixbuf; + + ani = gst_loader_load_animation (f, error); + if (ani == NULL) + return NULL; + + pixbuf = gdk_pixbuf_animation_get_static_image (ani); + if (!pixbuf) { + GST_ERROR_OBJECT (ani, "Could not get an image in _pixbuf_load"); + g_object_unref (ani); + g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + "Could not get an image from file."); + return NULL; + } + + g_object_ref (pixbuf); + g_object_unref (ani); + + return pixbuf; +} void fill_vtable (GdkPixbufModule *module) { + module->load = gst_loader_load; module->begin_load = gst_loader_begin_load; module->load_increment = gst_loader_load_increment; module->stop_load = gst_loader_stop_load; @@ -206,8 +231,9 @@ fill_info (GdkPixbufFormat *info) }; static gchar *mime_types[] = { - "video/avi", "video/x-avi", + "video/avi", "video/x-avi", "video/x-msvideo", "video/mpeg", + "video/quicktime", NULL }; -- cgit