Added another loader from Arjan to handle .ico files. Cool.

1999-11-29  Jonathan Blandford  <jrb@redhat.com>

        * src/Makefile.am (ICO_LIB): Added another loader from Arjan to
	handle .ico files.  Cool.
This commit is contained in:
Jonathan Blandford
1999-11-29 16:49:39 +00:00
committed by Jonathan Blandford
parent f0e6c2b1f3
commit 4aae90b5b1
4 changed files with 731 additions and 0 deletions

View File

@ -136,6 +136,23 @@ pixbuf_check_sunras (guchar *buffer, int size)
return TRUE;
}
static gboolean
pixbuf_check_ico (guchar *buffer, int size)
{
/* Note that this may cause false positives, but .ico's don't
have a magic number.*/
if (size < 6)
return FALSE;
if (buffer [0] != 0x0 ||
buffer [1] != 0x0 ||
buffer [2] != 0x1 ||
buffer [3] != 0x0 ||
buffer [5] != 0x0 )
return FALSE;
return TRUE;
}
static gboolean
pixbuf_check_bmp (guchar *buffer, int size)
@ -159,6 +176,7 @@ GdkPixbufModule file_formats [] = {
{ "xpm", pixbuf_check_xpm, NULL, NULL, NULL, NULL, NULL, NULL },
{ "pnm", pixbuf_check_pnm, NULL, NULL, NULL, NULL, NULL, NULL },
{ "ras", pixbuf_check_sunras, NULL, NULL, NULL, NULL, NULL, NULL },
{ "ico", pixbuf_check_ico, NULL, NULL, NULL, NULL, NULL, NULL },
{ "bmp", pixbuf_check_bmp, NULL, NULL, NULL, NULL, NULL, NULL },
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};