# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1319445053 0 # Node ID 3df86772b6256b24eabd46fd5f5aa9d9bdf67310 # Parent 35b177e8a0a2df12f2b43d8255756ac07be5656c Updated the list of supported image formats for GTK. This could be generated automatically by querying pixbuf loaders... However it does not take into account formats that support transparency. So for right now we keep using a static list... and include the most popular formats. diff -r 35b177e8a0a2 -r 3df86772b625 gtk/dw.c --- a/gtk/dw.c Mon Oct 24 08:01:42 2011 +0000 +++ b/gtk/dw.c Mon Oct 24 08:30:53 2011 +0000 @@ -101,14 +101,18 @@ /* * List those icons that have transparency first */ -#define NUM_EXTS 5 +#define NUM_EXTS 9 char *image_exts[NUM_EXTS] = { ".xpm", ".png", ".ico", + ".icns", + ".gif", ".jpg", - ".bmp", + ".jpeg", + ".tiff", + ".bmp" }; #ifndef max @@ -4557,7 +4561,7 @@ tmp = _find_pixmap(&bitmap, (HICN)id, handle, NULL, NULL); else { - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); #if GTK_MAJOR_VERSION > 1 GdkPixbuf *pixbuf; #elif defined(USE_IMLIB) @@ -6615,7 +6619,7 @@ #elif defined(USE_IMLIB) GdkImlibImage *image; #endif - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); unsigned long z, ret = 0; int found_ext = 0; int i; @@ -8357,7 +8361,7 @@ #ifdef USE_IMLIB GdkImlibImage *image; #endif - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); int found_ext = 0; int i; diff -r 35b177e8a0a2 -r 3df86772b625 gtk3/dw.c --- a/gtk3/dw.c Mon Oct 24 08:01:42 2011 +0000 +++ b/gtk3/dw.c Mon Oct 24 08:30:53 2011 +0000 @@ -96,14 +96,18 @@ /* * List those icons that have transparency first */ -#define NUM_EXTS 5 +#define NUM_EXTS 9 char *image_exts[NUM_EXTS] = { ".xpm", ".png", ".ico", + ".icns", + ".gif", ".jpg", - ".bmp", + ".jpeg", + ".tiff", + ".bmp" }; #ifndef max @@ -4206,7 +4210,7 @@ tmp = _find_pixbuf((HICN)id, NULL, NULL); else { - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); if (!file) { @@ -5624,7 +5628,7 @@ HICN API dw_icon_load_from_file(char *filename) { int _locked_by_me = FALSE; - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); int i, found_ext = 0; HICN ret = 0; @@ -7127,7 +7131,7 @@ { int _locked_by_me = FALSE; HPIXMAP pixmap; - char *file = alloca(strlen(filename) + 5); + char *file = alloca(strlen(filename) + 6); int found_ext = 0; int i;