summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/gdk-pixbuf-io.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-09-06 21:14:15 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-09-06 21:14:15 +0000
commit8a1a091f87b279ad36d6ec09f49d686fe3341807 (patch)
treec3fd8dd6807003a62524d289a1f2cb9b43811eab /gdk-pixbuf/gdk-pixbuf-io.c
parentab971600673024805d9906b791a1a54043a12855 (diff)
downloadgdk-pixbuf-8a1a091f87b279ad36d6ec09f49d686fe3341807.tar.gz
New loader, for .ANI animations.
* io-ani.c, io-ani-animation.h, io-ani-animation.c, pixbufloader_ani.def, Makefile.am, gdk-pixbuf-io.c: New loader, for .ANI animations.
Diffstat (limited to 'gdk-pixbuf/gdk-pixbuf-io.c')
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index aa6486752..dc760ac0a 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -164,6 +164,26 @@ pixbuf_check_ico (guchar *buffer, int size)
}
static gboolean
+pixbuf_check_ani (guchar *buffer, int size)
+{
+ if (size < 12)
+ return FALSE;
+
+ if (buffer [0] != 'R' ||
+ buffer [1] != 'I' ||
+ buffer [2] != 'F' ||
+ buffer [3] != 'F' ||
+ buffer [8] != 'A' ||
+ buffer [9] != 'C' ||
+ buffer[10] != 'O' ||
+ buffer[11] != 'N')
+ return FALSE;
+
+ return TRUE;
+}
+
+
+static gboolean
pixbuf_check_bmp (guchar *buffer, int size)
{
if (size < 20)
@@ -241,7 +261,9 @@ static GdkPixbufModule file_formats [] = {
{ "ras", pixbuf_check_sunras, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "xbm", pixbuf_check_xbm, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
- { "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, { "tga", pixbuf_check_tga, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ { "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ { "ani", pixbuf_check_ani, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
+ { "tga", pixbuf_check_tga, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ "wbmp", pixbuf_check_wbmp, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
@@ -392,6 +414,7 @@ m_fill_vtable (bmp);
m_fill_vtable (wbmp);
m_fill_vtable (gif);
m_fill_vtable (ico);
+m_fill_vtable (ani);
m_fill_vtable (jpeg);
m_fill_vtable (pnm);
m_fill_vtable (ras);
@@ -441,6 +464,12 @@ _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
}
#endif
+#ifdef INCLUDE_ani
+ else if (strcmp (image_module->module_name, "ani") == 0){
+ fill_vtable = mname (ani, fill_vtable);
+ }
+#endif
+
#ifdef INCLUDE_jpeg
else if (strcmp (image_module->module_name, "jpeg") == 0){
fill_vtable = mname (jpeg, fill_vtable);