Author: cazfi
Date: Thu Jan  5 16:57:19 2017
New Revision: 34789

URL: http://svn.gna.org/viewcvs/freeciv?rev=34789&view=rev
Log:
Consider '.png' supported even if there's no mime-type called 'png'

See patch #8062

Modified:
    trunk/client/gui-gtk-3.0/sprite.c
    trunk/client/gui-gtk-3.22/sprite.c

Modified: trunk/client/gui-gtk-3.0/sprite.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/sprite.c?rev=34789&r1=34788&r2=34789&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/sprite.c   (original)
+++ trunk/client/gui-gtk-3.0/sprite.c   Thu Jan  5 16:57:19 2017
@@ -111,8 +111,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
   };
@@ -126,6 +126,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: trunk/client/gui-gtk-3.22/sprite.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.22/sprite.c?rev=34789&r1=34788&r2=34789&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.22/sprite.c  (original)
+++ trunk/client/gui-gtk-3.22/sprite.c  Thu Jan  5 16:57:19 2017
@@ -111,8 +111,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
   };
@@ -126,6 +126,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

Reply via email to