Index: src/gtkaccount.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkaccount.c,v retrieving revision 1.142 diff -u -p -r1.142 gtkaccount.c --- src/gtkaccount.c 7 Aug 2004 17:04:07 -0000 1.142 +++ src/gtkaccount.c 7 Aug 2004 17:26:11 -0000 @@ -573,12 +573,27 @@ convert_buddy_icon(GaimPlugin *plugin, c g_error_free(error); return NULL; } + + if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) + { + gaim_debug_info("buddyicon", "Creating icon cache directory.\n"); + + if (mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0) + { + gaim_debug_error("buddyicon", + "Unable to create directory %s: %s\n", + dirname, strerror(errno)); + return NULL; + } + } + for (i = 0; prpl_formats[i]; i++) { gaim_debug_info("buddyicon", "Converting buddy icon to %s as %s\n", prpl_formats[i], filename); /* The gdk-pixbuf documentation is wrong. gdk_pixbuf_save returns TRUE if it was successful, * FALSE if an error was set. */ - if (gdk_pixbuf_save (pixbuf, filename, prpl_formats[i], &error, NULL) == TRUE) - break; + if (gdk_pixbuf_format_is_writable(prpl_formats[i]) && + gdk_pixbuf_save (pixbuf, filename, prpl_formats[i], &error, NULL) == TRUE) + break; } if (!error) { g_free(random);