Author: cazfi
Date: Thu Jan  5 16:57:25 2017
New Revision: 34790

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

See patch #8062

Modified:
    branches/S3_0/client/gui-gtk-2.0/sprite.c
    branches/S3_0/client/gui-gtk-3.0/sprite.c
    branches/S3_0/client/gui-gtk-3.22/sprite.c

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