Author: cazfi Date: Thu Jan 5 16:57:30 2017 New Revision: 34791 URL: http://svn.gna.org/viewcvs/freeciv?rev=34791&view=rev Log: Consider '.png' supported even if there's no mime-type called 'png'
See patch #8062 Modified: branches/S2_6/client/gui-gtk-2.0/sprite.c branches/S2_6/client/gui-gtk-3.0/sprite.c branches/S2_6/client/gui-gtk-3.22/sprite.c Modified: branches/S2_6/client/gui-gtk-2.0/sprite.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-2.0/sprite.c?rev=34791&r1=34790&r2=34791&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-2.0/sprite.c (original) +++ branches/S2_6/client/gui-gtk-2.0/sprite.c Thu Jan 5 16:57:30 2017 @@ -204,8 +204,8 @@ ****************************************************************************/ const char **gfx_fileextensions(void) { - /* Includes space for termination NULL */ - static const char *ext[MAX_FILE_EXTENSIONS + 1] = + /* Includes space for hardcoded 'png' and termination NULL */ + static const char *ext[MAX_FILE_EXTENSIONS + 2] = { NULL }; @@ -219,6 +219,9 @@ GdkPixbufFormat *format = g_slist_nth_data(next, 0); gchar **mimes = gdk_pixbuf_format_get_mime_types(format); int i; + + /* Consider .png to be supported even when there's no mime-type called "png" */ + ext[count++] = fc_strdup("png"); for (i = 0; mimes[i] != NULL && count < MAX_FILE_EXTENSIONS; i++) { char *end = strstr(mimes[i], "/"); Modified: branches/S2_6/client/gui-gtk-3.0/sprite.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/sprite.c?rev=34791&r1=34790&r2=34791&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-3.0/sprite.c (original) +++ branches/S2_6/client/gui-gtk-3.0/sprite.c Thu Jan 5 16:57:30 2017 @@ -109,8 +109,8 @@ ****************************************************************************/ const char **gfx_fileextensions(void) { - /* Includes space for termination NULL */ - static const char *ext[MAX_FILE_EXTENSIONS + 1] = + /* Includes space for hardcoded 'png' and termination NULL */ + static const char *ext[MAX_FILE_EXTENSIONS + 2] = { NULL }; @@ -124,6 +124,9 @@ GdkPixbufFormat *format = g_slist_nth_data(next, 0); gchar **mimes = gdk_pixbuf_format_get_mime_types(format); int i; + + /* Consider .png to be supported even when there's no mime-type called "png" */ + ext[count++] = fc_strdup("png"); for (i = 0; mimes[i] != NULL && count < MAX_FILE_EXTENSIONS; i++) { char *end = strstr(mimes[i], "/"); Modified: branches/S2_6/client/gui-gtk-3.22/sprite.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/sprite.c?rev=34791&r1=34790&r2=34791&view=diff ============================================================================== --- branches/S2_6/client/gui-gtk-3.22/sprite.c (original) +++ branches/S2_6/client/gui-gtk-3.22/sprite.c Thu Jan 5 16:57:30 2017 @@ -109,8 +109,8 @@ ****************************************************************************/ const char **gfx_fileextensions(void) { - /* Includes space for termination NULL */ - static const char *ext[MAX_FILE_EXTENSIONS + 1] = + /* Includes space for hardcoded 'png' and termination NULL */ + static const char *ext[MAX_FILE_EXTENSIONS + 2] = { NULL }; @@ -124,6 +124,9 @@ GdkPixbufFormat *format = g_slist_nth_data(next, 0); gchar **mimes = gdk_pixbuf_format_get_mime_types(format); int i; + + /* Consider .png to be supported even when there's no mime-type called "png" */ + ext[count++] = fc_strdup("png"); for (i = 0; mimes[i] != NULL && count < MAX_FILE_EXTENSIONS; i++) { char *end = strstr(mimes[i], "/"); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits