[arch-commits] Commit in libgdiplus/repos (24 files)

Jelle van der Waa jelle at archlinux.org
Tue Oct 17 18:01:57 UTC 2017


    Date: Tuesday, October 17, 2017 @ 18:01:56
  Author: jelle
Revision: 308163

archrelease: copy trunk to extra-i686, extra-x86_64

Added:
  libgdiplus/repos/extra-i686/PKGBUILD
    (from rev 308162, libgdiplus/trunk/PKGBUILD)
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-freetype25.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-freetype25.patch)
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-giflib-5.1.0.patch)
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-gold.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-gold.patch)
  libgdiplus/repos/extra-i686/libgdiplus0-giflib5.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus0-giflib5.patch)
  libgdiplus/repos/extra-i686/libpng15.patch
    (from rev 308162, libgdiplus/trunk/libpng15.patch)
  libgdiplus/repos/extra-x86_64/PKGBUILD
    (from rev 308162, libgdiplus/trunk/PKGBUILD)
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-freetype25.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-freetype25.patch)
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-giflib-5.1.0.patch)
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-gold.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-gold.patch)
  libgdiplus/repos/extra-x86_64/libgdiplus0-giflib5.patch
    (from rev 308162, libgdiplus/trunk/libgdiplus0-giflib5.patch)
  libgdiplus/repos/extra-x86_64/libpng15.patch
    (from rev 308162, libgdiplus/trunk/libpng15.patch)
Deleted:
  libgdiplus/repos/extra-i686/PKGBUILD
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-freetype25.patch
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch
  libgdiplus/repos/extra-i686/libgdiplus-2.10.9-gold.patch
  libgdiplus/repos/extra-i686/libgdiplus0-giflib5.patch
  libgdiplus/repos/extra-i686/libpng15.patch
  libgdiplus/repos/extra-x86_64/PKGBUILD
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-freetype25.patch
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch
  libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-gold.patch
  libgdiplus/repos/extra-x86_64/libgdiplus0-giflib5.patch
  libgdiplus/repos/extra-x86_64/libpng15.patch

---------------------------------------------------+
 /PKGBUILD                                         |   60 +++
 /libgdiplus-2.10.9-freetype25.patch               |   52 +++
 /libgdiplus-2.10.9-giflib-5.1.0.patch             |   60 +++
 /libgdiplus-2.10.9-gold.patch                     |   32 +
 /libgdiplus0-giflib5.patch                        |  274 ++++++++++++++++
 /libpng15.patch                                   |  328 ++++++++++++++++++++
 extra-i686/PKGBUILD                               |   30 -
 extra-i686/libgdiplus-2.10.9-freetype25.patch     |   26 -
 extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch   |   30 -
 extra-i686/libgdiplus-2.10.9-gold.patch           |   16 
 extra-i686/libgdiplus0-giflib5.patch              |  137 --------
 extra-i686/libpng15.patch                         |  164 ----------
 extra-x86_64/PKGBUILD                             |   30 -
 extra-x86_64/libgdiplus-2.10.9-freetype25.patch   |   26 -
 extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch |   30 -
 extra-x86_64/libgdiplus-2.10.9-gold.patch         |   16 
 extra-x86_64/libgdiplus0-giflib5.patch            |  137 --------
 extra-x86_64/libpng15.patch                       |  164 ----------
 18 files changed, 806 insertions(+), 806 deletions(-)

Deleted: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/PKGBUILD	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,30 +0,0 @@
-# $Id$
-# Maintainer: Daniel Isenmann <daniel at archlinux.org>
-
-pkgname=libgdiplus
-pkgver=4.2
-pkgrel=1
-pkgdesc="An Open Source Implementation of the GDI+ API"
-arch=(i686 x86_64)
-license=('MPL' 'LGPL')
-url="http://www.mono-project.com"
-depends=('libtiff' 'cairo' 'giflib' 'glib2' 'libexif')
-source=(http://download.mono-project.com/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('3e68075aa0911d5ebc2b3739e85af0ea')
-
-prepare() {
-  cd ${pkgname}-${pkgver}
-  sed -i -e 's/-L\${libjpeg_prefix}\/lib -ljpeg/-ljpeg/' configure
-}
-
-build() {
-  cd ${pkgname}-${pkgver}
-  ./configure --prefix=/usr --with-cairo=system
-
-  make
-}
-
-package() {
-  cd ${pkgname}-${pkgver}
-  make DESTDIR="${pkgdir}" install
-}

Copied: libgdiplus/repos/extra-i686/PKGBUILD (from rev 308162, libgdiplus/trunk/PKGBUILD)
===================================================================
--- extra-i686/PKGBUILD	                        (rev 0)
+++ extra-i686/PKGBUILD	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,30 @@
+# $Id$
+# Maintainer: Daniel Isenmann <daniel at archlinux.org>
+
+pkgname=libgdiplus
+pkgver=4.2
+pkgrel=2
+pkgdesc="An Open Source Implementation of the GDI+ API"
+arch=(i686 x86_64)
+license=('MPL' 'LGPL')
+url="http://www.mono-project.com"
+depends=('libtiff' 'cairo' 'giflib' 'glib2' 'libexif')
+source=(http://download.mono-project.com/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('3e68075aa0911d5ebc2b3739e85af0ea')
+
+prepare() {
+  cd ${pkgname}-${pkgver}
+  sed -i -e 's/-L\${libjpeg_prefix}\/lib -ljpeg/-ljpeg/' configure
+}
+
+build() {
+  cd ${pkgname}-${pkgver}
+  ./configure --prefix=/usr --with-cairo=system
+
+  make
+}
+
+package() {
+  cd ${pkgname}-${pkgver}
+  make DESTDIR="${pkgdir}" install
+}

Deleted: extra-i686/libgdiplus-2.10.9-freetype25.patch
===================================================================
--- extra-i686/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,26 +0,0 @@
-commit 180c02e0f2a2016eba8520b456ca929e9dcf03db
-Author: Jo Shields <directhex at apebox.org>
-Date:   Mon Dec 16 09:24:57 2013 +0000
-
-    Use FreeType macros for tttables.h inclusion
-    
-    As of FreeType 2.1.6 (November 2003), using #include to include Freetype libraries directly is not supported.
-    
-    This has come to a head, as in FreeType 2.5.0, the location of headers has been moved around, breaking building of libgdiplus.
-    
-    This slight change uses the "official" way to include the required header file, without breaking building on older versions of the library.
-
-diff --git a/src/gdiplus-private.h b/src/gdiplus-private.h
-index 59edf9e..dfccc02 100644
---- a/src/gdiplus-private.h
-+++ b/src/gdiplus-private.h
-@@ -30,7 +30,8 @@
- #include <stdio.h>
- #include <math.h>
- #include <glib.h>
--#include <freetype/tttables.h>
-+#include <ft2build.h>
-+#include FT_TRUETYPE_TABLES_H
- #include <pthread.h>
- #include <unistd.h>
- 

Copied: libgdiplus/repos/extra-i686/libgdiplus-2.10.9-freetype25.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-freetype25.patch)
===================================================================
--- extra-i686/libgdiplus-2.10.9-freetype25.patch	                        (rev 0)
+++ extra-i686/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,26 @@
+commit 180c02e0f2a2016eba8520b456ca929e9dcf03db
+Author: Jo Shields <directhex at apebox.org>
+Date:   Mon Dec 16 09:24:57 2013 +0000
+
+    Use FreeType macros for tttables.h inclusion
+    
+    As of FreeType 2.1.6 (November 2003), using #include to include Freetype libraries directly is not supported.
+    
+    This has come to a head, as in FreeType 2.5.0, the location of headers has been moved around, breaking building of libgdiplus.
+    
+    This slight change uses the "official" way to include the required header file, without breaking building on older versions of the library.
+
+diff --git a/src/gdiplus-private.h b/src/gdiplus-private.h
+index 59edf9e..dfccc02 100644
+--- a/src/gdiplus-private.h
++++ b/src/gdiplus-private.h
+@@ -30,7 +30,8 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <freetype/tttables.h>
++#include <ft2build.h>
++#include FT_TRUETYPE_TABLES_H
+ #include <pthread.h>
+ #include <unistd.h>
+ 

Deleted: extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch
===================================================================
--- extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,30 +0,0 @@
-diff -rupN a/src/gifcodec.c b/src/gifcodec.c
---- a/src/gifcodec.c	2011-12-02 18:23:12.000000000 +0100
-+++ b/src/gifcodec.c	2014-06-01 13:20:17.027203704 +0200
-@@ -581,7 +581,7 @@ gdip_load_gif_image (void *stream, GpIma
- 	}
- 
- 	FreeExtensionMono(&global_extensions);
--	DGifCloseFile (gif);
-+	DGifCloseFile (gif, NULL);
- 
- 	*image = result;
- 	return Ok;
-@@ -597,7 +597,7 @@ error:
- 
- 	if (gif != NULL) {
- 		FreeExtensionMono (&global_extensions);
--		DGifCloseFile (gif);
-+		DGifCloseFile (gif, NULL);
- 	}
- 
- 	*image = NULL;
-@@ -923,7 +923,7 @@ gdip_save_gif_image (void *stream, GpIma
- 		}
- 	}
- 
--	EGifCloseFile (fp);	
-+	EGifCloseFile (fp, NULL);	
- 	
- 	return Ok;
- 

Copied: libgdiplus/repos/extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-giflib-5.1.0.patch)
===================================================================
--- extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch	                        (rev 0)
+++ extra-i686/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,30 @@
+diff -rupN a/src/gifcodec.c b/src/gifcodec.c
+--- a/src/gifcodec.c	2011-12-02 18:23:12.000000000 +0100
++++ b/src/gifcodec.c	2014-06-01 13:20:17.027203704 +0200
+@@ -581,7 +581,7 @@ gdip_load_gif_image (void *stream, GpIma
+ 	}
+ 
+ 	FreeExtensionMono(&global_extensions);
+-	DGifCloseFile (gif);
++	DGifCloseFile (gif, NULL);
+ 
+ 	*image = result;
+ 	return Ok;
+@@ -597,7 +597,7 @@ error:
+ 
+ 	if (gif != NULL) {
+ 		FreeExtensionMono (&global_extensions);
+-		DGifCloseFile (gif);
++		DGifCloseFile (gif, NULL);
+ 	}
+ 
+ 	*image = NULL;
+@@ -923,7 +923,7 @@ gdip_save_gif_image (void *stream, GpIma
+ 		}
+ 	}
+ 
+-	EGifCloseFile (fp);	
++	EGifCloseFile (fp, NULL);	
+ 	
+ 	return Ok;
+ 

Deleted: extra-i686/libgdiplus-2.10.9-gold.patch
===================================================================
--- extra-i686/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,16 +0,0 @@
- tests/Makefile.in |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/tests/Makefile.in b/tests/Makefile.in
-index 97f5f4e..c02ca25 100644
---- a/tests/Makefile.in
-+++ b/tests/Makefile.in
-@@ -228,7 +228,7 @@ DEPS = \
- 	$(top_builddir)/src/libgdiplus.la
- 
- LDADDS = \
--	$(top_builddir)/src/libgdiplus.la
-+	$(top_builddir)/src/libgdiplus.la -lX11 -lglib-2.0
- 
- testgdi_DEPENDENCIES = $(TEST_DEPS)
- testgdi_LDADD = $(LDADDS)

Copied: libgdiplus/repos/extra-i686/libgdiplus-2.10.9-gold.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-gold.patch)
===================================================================
--- extra-i686/libgdiplus-2.10.9-gold.patch	                        (rev 0)
+++ extra-i686/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,16 @@
+ tests/Makefile.in |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 97f5f4e..c02ca25 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -228,7 +228,7 @@ DEPS = \
+ 	$(top_builddir)/src/libgdiplus.la
+ 
+ LDADDS = \
+-	$(top_builddir)/src/libgdiplus.la
++	$(top_builddir)/src/libgdiplus.la -lX11 -lglib-2.0
+ 
+ testgdi_DEPENDENCIES = $(TEST_DEPS)
+ testgdi_LDADD = $(LDADDS)

Deleted: extra-i686/libgdiplus0-giflib5.patch
===================================================================
--- extra-i686/libgdiplus0-giflib5.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/libgdiplus0-giflib5.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,137 +0,0 @@
----
- src/gifcodec.c |   50 +++++++++++++++++++++++++++++++++++++++++---------
- 1 file changed, 41 insertions(+), 9 deletions(-)
-
-Index: libgdiplus-2.10.9/src/gifcodec.c
-===================================================================
---- libgdiplus-2.10.9.orig/src/gifcodec.c
-+++ libgdiplus-2.10.9/src/gifcodec.c
-@@ -105,7 +112,7 @@ gdip_gif_inputfunc (GifFileType *gif, Gi
- */
- 
- static int
--AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
-+AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
- {
- 	ExtensionBlock	*ep;
- 
-@@ -129,7 +136,7 @@ AddExtensionBlockMono(SavedImage *New, i
- 
- 	if (ExtData) {
- 		memcpy(ep->Bytes, ExtData, Len);
--		ep->Function = New->Function;
-+		ep->Function = func;
- 	}
- 
- 	return (GIF_OK);
-@@ -232,20 +239,20 @@ DGifSlurpMono(GifFileType * GifFile, Sav
- 			}
- 
- 			case EXTENSION_RECORD_TYPE: {
--				if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
-+				int func;
-+				if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
- 					return (GIF_ERROR);
- 				}
- 
- 				while (ExtData != NULL) {
- 					/* Create an extension block with our data */
--					if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
-+					if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
- 
- 					if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
--					temp_save.Function = 0;
- 				}
- 				break;
- 			}
-@@ -303,12 +310,19 @@ gdip_load_gif_image (void *stream, GpIma
- 	result = NULL;
- 	loop_counter = FALSE;
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
- 	} else {
- 		gif = DGifOpen (stream, &gdip_gif_inputfunc);
- 	}
--	
-+#else
-+	if (from_file)
-+		gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
-+	else
-+		gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
-+#endif
-+
- 	if (gif == NULL) {
- 		goto error;
- 	}
-@@ -581,7 +595,7 @@ gdip_load_gif_image (void *stream, GpIma
- 	}
- 
- 	FreeExtensionMono(&global_extensions);
--	DGifCloseFile (gif);
-+	DGifCloseFile (gif, NULL);
- 
- 	*image = result;
- 	return Ok;
-@@ -597,7 +611,7 @@ error:
- 
- 	if (gif != NULL) {
- 		FreeExtensionMono (&global_extensions);
--		DGifCloseFile (gif);
-+		DGifCloseFile (gif, NULL);
- 	}
- 
- 	*image = NULL;
-@@ -660,11 +674,22 @@ gdip_save_gif_image (void *stream, GpIma
- 		return InvalidParameter;
- 	}
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		fp = EGifOpenFileName (stream, 0);
- 	} else {
- 		fp = EGifOpen (stream, gdip_gif_outputfunc);
- 	}
-+#else
-+	if (from_file)
-+		fp = EGifOpenFileName (stream, 0, NULL);
-+	else
-+		fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
-+#define MakeMapObject  GifMakeMapObject
-+#define FreeMapObject  GifFreeMapObject
-+#define QuantizeBuffer GifQuantizeBuffer
-+#define BitSize        GifBitSize
-+#endif
- 		
- 	if (!fp) {
- 		return FileNotFound;
-@@ -848,8 +873,15 @@ gdip_save_gif_image (void *stream, GpIma
- 						Buffer[0] = 1;
- 						Buffer[1] = ptr[0];
- 						Buffer[2] = ptr[1];
-+#if GIFLIB_MAJOR < 5
- 						EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
- 						EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
-+#else
-+						EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
-+						EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
-+						EGifPutExtensionBlock(fp, 3, Buffer);
-+						EGifPutExtensionTrailer(fp);
-+#endif
- 					}
- 				}
- 
-@@ -923,7 +955,7 @@ gdip_save_gif_image (void *stream, GpIma
- 		}
- 	}
- 
--	EGifCloseFile (fp);	
-+	EGifCloseFile (fp, NULL);
- 	
- 	return Ok;
- 

Copied: libgdiplus/repos/extra-i686/libgdiplus0-giflib5.patch (from rev 308162, libgdiplus/trunk/libgdiplus0-giflib5.patch)
===================================================================
--- extra-i686/libgdiplus0-giflib5.patch	                        (rev 0)
+++ extra-i686/libgdiplus0-giflib5.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,137 @@
+---
+ src/gifcodec.c |   50 +++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 41 insertions(+), 9 deletions(-)
+
+Index: libgdiplus-2.10.9/src/gifcodec.c
+===================================================================
+--- libgdiplus-2.10.9.orig/src/gifcodec.c
++++ libgdiplus-2.10.9/src/gifcodec.c
+@@ -105,7 +112,7 @@ gdip_gif_inputfunc (GifFileType *gif, Gi
+ */
+ 
+ static int
+-AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
++AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
+ {
+ 	ExtensionBlock	*ep;
+ 
+@@ -129,7 +136,7 @@ AddExtensionBlockMono(SavedImage *New, i
+ 
+ 	if (ExtData) {
+ 		memcpy(ep->Bytes, ExtData, Len);
+-		ep->Function = New->Function;
++		ep->Function = func;
+ 	}
+ 
+ 	return (GIF_OK);
+@@ -232,20 +239,20 @@ DGifSlurpMono(GifFileType * GifFile, Sav
+ 			}
+ 
+ 			case EXTENSION_RECORD_TYPE: {
+-				if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
++				int func;
++				if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
+ 					return (GIF_ERROR);
+ 				}
+ 
+ 				while (ExtData != NULL) {
+ 					/* Create an extension block with our data */
+-					if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
++					if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
+ 						return (GIF_ERROR);
+ 					}
+ 
+ 					if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
+ 						return (GIF_ERROR);
+ 					}
+-					temp_save.Function = 0;
+ 				}
+ 				break;
+ 			}
+@@ -303,12 +310,19 @@ gdip_load_gif_image (void *stream, GpIma
+ 	result = NULL;
+ 	loop_counter = FALSE;
+ 
++#if GIFLIB_MAJOR < 5
+ 	if (from_file) {
+ 		gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
+ 	} else {
+ 		gif = DGifOpen (stream, &gdip_gif_inputfunc);
+ 	}
+-	
++#else
++	if (from_file)
++		gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
++	else
++		gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
++#endif
++
+ 	if (gif == NULL) {
+ 		goto error;
+ 	}
+@@ -581,7 +595,7 @@ gdip_load_gif_image (void *stream, GpIma
+ 	}
+ 
+ 	FreeExtensionMono(&global_extensions);
+-	DGifCloseFile (gif);
++	DGifCloseFile (gif, NULL);
+ 
+ 	*image = result;
+ 	return Ok;
+@@ -597,7 +611,7 @@ error:
+ 
+ 	if (gif != NULL) {
+ 		FreeExtensionMono (&global_extensions);
+-		DGifCloseFile (gif);
++		DGifCloseFile (gif, NULL);
+ 	}
+ 
+ 	*image = NULL;
+@@ -660,11 +674,22 @@ gdip_save_gif_image (void *stream, GpIma
+ 		return InvalidParameter;
+ 	}
+ 
++#if GIFLIB_MAJOR < 5
+ 	if (from_file) {
+ 		fp = EGifOpenFileName (stream, 0);
+ 	} else {
+ 		fp = EGifOpen (stream, gdip_gif_outputfunc);
+ 	}
++#else
++	if (from_file)
++		fp = EGifOpenFileName (stream, 0, NULL);
++	else
++		fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
++#define MakeMapObject  GifMakeMapObject
++#define FreeMapObject  GifFreeMapObject
++#define QuantizeBuffer GifQuantizeBuffer
++#define BitSize        GifBitSize
++#endif
+ 		
+ 	if (!fp) {
+ 		return FileNotFound;
+@@ -848,8 +873,15 @@ gdip_save_gif_image (void *stream, GpIma
+ 						Buffer[0] = 1;
+ 						Buffer[1] = ptr[0];
+ 						Buffer[2] = ptr[1];
++#if GIFLIB_MAJOR < 5
+ 						EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
+ 						EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
++#else
++						EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
++						EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
++						EGifPutExtensionBlock(fp, 3, Buffer);
++						EGifPutExtensionTrailer(fp);
++#endif
+ 					}
+ 				}
+ 
+@@ -923,7 +955,7 @@ gdip_save_gif_image (void *stream, GpIma
+ 		}
+ 	}
+ 
+-	EGifCloseFile (fp);	
++	EGifCloseFile (fp, NULL);
+ 	
+ 	return Ok;
+ 

Deleted: extra-i686/libpng15.patch
===================================================================
--- extra-i686/libpng15.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-i686/libpng15.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,164 +0,0 @@
-$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
-
-Fix build with png-1.5.
-
---- src/pngcodec.c.orig	2010-11-03 16:52:54.000000000 +0000
-+++ src/pngcodec.c
-@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
- 	bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
- 	bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
- #elif defined(PNG_pHYs_SUPPORTED)
--	if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
--		bitmap_data->image_flags |= ImageFlagsHasRealDPI;
--		bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
--		bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
-+	if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
-+		png_uint_32 res_x, res_y;
-+		int unit_type;
-+		png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
-+		if (unit_type == PNG_RESOLUTION_METER) {
-+			bitmap_data->image_flags |= ImageFlagsHasRealDPI;
-+			bitmap_data->dpi_horz = res_x * 0.0254;
-+			bitmap_data->dpi_vert = res_y * 0.0254;
-+		}
- 	}
- #endif
- 	/* default to screen resolution (if nothing was provided or available) */
-@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
- #if defined(PNG_iCCP_SUPPORTED)
- 	{
- 		png_charp	name;
--		png_charp	profile;
-+		png_bytep	profile;
- 		png_uint_32	proflen;
- 		int		compression_type;
- 
-@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream 
- 		ImageFlags	colourspace_flag;
- 		int		i;
- 		int		j;
-+		png_colorp	png_palette;
-+		int		png_num_palette;
-+		png_bytep	trans_alpha;
-+		int		num_trans;
-+		png_color_16p	trans_color;
- 
- 		width = png_get_image_width (png_ptr, info_ptr);
- 		height = png_get_image_height (png_ptr, info_ptr);
-@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream 
- 		}
- 
- 		/* Copy palette. */
-+		png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
-+
- 		num_colours = 1 << bit_depth;
- 
- 		if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
-@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream 
- 			colourspace_flag = ImageFlagsColorSpaceRGB;
- 
- 			palette_entries = num_colours;
--			if (palette_entries > info_ptr->num_palette) {
--				palette_entries = info_ptr->num_palette;
-+			if (palette_entries > png_num_palette) {
-+				palette_entries = png_num_palette;
- 			}
- 
- 			palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
-@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream 
- 
- 			for (i=0; i < palette_entries; i++) {
- 				set_pixel_bgra (&palette->Entries[i], 0,
--						info_ptr->palette[i].blue,
--						info_ptr->palette[i].green,
--						info_ptr->palette[i].red,
-+						png_palette[i].blue,
-+						png_palette[i].green,
-+						png_palette[i].red,
- 						0xFF); /* alpha */
- 			}
- 		}
- 
-+		png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
- 		/* Make sure transparency is respected. */
--		if (info_ptr->num_trans > 0) {
-+		if (num_trans > 0) {
- 			palette->Flags |= PaletteFlagsHasAlpha;
- 			colourspace_flag |= ImageFlagsHasAlpha;
- 
--			if (info_ptr->num_trans > info_ptr->num_palette) {
--				info_ptr->num_trans = info_ptr->num_palette;
-+			if (num_trans > png_num_palette) {
-+				num_trans = png_num_palette;
- 			}
- 
--			for (i=0; i < info_ptr->num_trans; i++) {
-+			for (i=0; i < num_trans; i++) {
- 				set_pixel_bgra(&palette->Entries[i], 0,
--						info_ptr->palette[i].blue,
--						info_ptr->palette[i].green,
--						info_ptr->palette[i].red,
-+						png_palette[i].blue,
-+						png_palette[i].green,
-+						png_palette[i].red,
- #if PNG_LIBPNG_VER > 10399
--						info_ptr->trans_alpha [i]); /* alpha */
-+						trans_alpha [i]); /* alpha */
- #else
- 						info_ptr->trans[i]); /* alpha */
- #endif
-@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream 
- 		BYTE		bit_depth;
- 		int		stride;
- 		int		interlace;
-+		png_colorp	png_palette;
-+		int		png_num_palette;
- 		png_bytep *row_pointers;
- 		BYTE *rawptr;
- 		int i, j;
-@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream 
- 							png_byte palette = 0;
- 							png_byte pix = *rowp++;
- 
-+							png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
- 							palette = (pix >> 6) & 0x03;
- 							set_pixel_bgra (rawptr, 0,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = (pix >> 4) & 0x03;
- 							set_pixel_bgra (rawptr, 4,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = (pix >> 2) & 0x03;
- 							set_pixel_bgra (rawptr, 8,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = pix & 0x03;
- 							set_pixel_bgra (rawptr, 12,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 							rawptr += 16;
- 						}

Copied: libgdiplus/repos/extra-i686/libpng15.patch (from rev 308162, libgdiplus/trunk/libpng15.patch)
===================================================================
--- extra-i686/libpng15.patch	                        (rev 0)
+++ extra-i686/libpng15.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,164 @@
+$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
+
+Fix build with png-1.5.
+
+--- src/pngcodec.c.orig	2010-11-03 16:52:54.000000000 +0000
++++ src/pngcodec.c
+@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
+ 	bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
+ 	bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
+ #elif defined(PNG_pHYs_SUPPORTED)
+-	if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
+-		bitmap_data->image_flags |= ImageFlagsHasRealDPI;
+-		bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
+-		bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
++	if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
++		png_uint_32 res_x, res_y;
++		int unit_type;
++		png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
++		if (unit_type == PNG_RESOLUTION_METER) {
++			bitmap_data->image_flags |= ImageFlagsHasRealDPI;
++			bitmap_data->dpi_horz = res_x * 0.0254;
++			bitmap_data->dpi_vert = res_y * 0.0254;
++		}
+ 	}
+ #endif
+ 	/* default to screen resolution (if nothing was provided or available) */
+@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
+ #if defined(PNG_iCCP_SUPPORTED)
+ 	{
+ 		png_charp	name;
+-		png_charp	profile;
++		png_bytep	profile;
+ 		png_uint_32	proflen;
+ 		int		compression_type;
+ 
+@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream 
+ 		ImageFlags	colourspace_flag;
+ 		int		i;
+ 		int		j;
++		png_colorp	png_palette;
++		int		png_num_palette;
++		png_bytep	trans_alpha;
++		int		num_trans;
++		png_color_16p	trans_color;
+ 
+ 		width = png_get_image_width (png_ptr, info_ptr);
+ 		height = png_get_image_height (png_ptr, info_ptr);
+@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream 
+ 		}
+ 
+ 		/* Copy palette. */
++		png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
++
+ 		num_colours = 1 << bit_depth;
+ 
+ 		if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
+@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream 
+ 			colourspace_flag = ImageFlagsColorSpaceRGB;
+ 
+ 			palette_entries = num_colours;
+-			if (palette_entries > info_ptr->num_palette) {
+-				palette_entries = info_ptr->num_palette;
++			if (palette_entries > png_num_palette) {
++				palette_entries = png_num_palette;
+ 			}
+ 
+ 			palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
+@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream 
+ 
+ 			for (i=0; i < palette_entries; i++) {
+ 				set_pixel_bgra (&palette->Entries[i], 0,
+-						info_ptr->palette[i].blue,
+-						info_ptr->palette[i].green,
+-						info_ptr->palette[i].red,
++						png_palette[i].blue,
++						png_palette[i].green,
++						png_palette[i].red,
+ 						0xFF); /* alpha */
+ 			}
+ 		}
+ 
++		png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
+ 		/* Make sure transparency is respected. */
+-		if (info_ptr->num_trans > 0) {
++		if (num_trans > 0) {
+ 			palette->Flags |= PaletteFlagsHasAlpha;
+ 			colourspace_flag |= ImageFlagsHasAlpha;
+ 
+-			if (info_ptr->num_trans > info_ptr->num_palette) {
+-				info_ptr->num_trans = info_ptr->num_palette;
++			if (num_trans > png_num_palette) {
++				num_trans = png_num_palette;
+ 			}
+ 
+-			for (i=0; i < info_ptr->num_trans; i++) {
++			for (i=0; i < num_trans; i++) {
+ 				set_pixel_bgra(&palette->Entries[i], 0,
+-						info_ptr->palette[i].blue,
+-						info_ptr->palette[i].green,
+-						info_ptr->palette[i].red,
++						png_palette[i].blue,
++						png_palette[i].green,
++						png_palette[i].red,
+ #if PNG_LIBPNG_VER > 10399
+-						info_ptr->trans_alpha [i]); /* alpha */
++						trans_alpha [i]); /* alpha */
+ #else
+ 						info_ptr->trans[i]); /* alpha */
+ #endif
+@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream 
+ 		BYTE		bit_depth;
+ 		int		stride;
+ 		int		interlace;
++		png_colorp	png_palette;
++		int		png_num_palette;
+ 		png_bytep *row_pointers;
+ 		BYTE *rawptr;
+ 		int i, j;
+@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream 
+ 							png_byte palette = 0;
+ 							png_byte pix = *rowp++;
+ 
++							png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
+ 							palette = (pix >> 6) & 0x03;
+ 							set_pixel_bgra (rawptr, 0,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = (pix >> 4) & 0x03;
+ 							set_pixel_bgra (rawptr, 4,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = (pix >> 2) & 0x03;
+ 							set_pixel_bgra (rawptr, 8,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = pix & 0x03;
+ 							set_pixel_bgra (rawptr, 12,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 							rawptr += 16;
+ 						}

Deleted: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/PKGBUILD	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,30 +0,0 @@
-# $Id$
-# Maintainer: Daniel Isenmann <daniel at archlinux.org>
-
-pkgname=libgdiplus
-pkgver=4.2
-pkgrel=1
-pkgdesc="An Open Source Implementation of the GDI+ API"
-arch=(i686 x86_64)
-license=('MPL' 'LGPL')
-url="http://www.mono-project.com"
-depends=('libtiff' 'cairo' 'giflib' 'glib2' 'libexif')
-source=(http://download.mono-project.com/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('3e68075aa0911d5ebc2b3739e85af0ea')
-
-prepare() {
-  cd ${pkgname}-${pkgver}
-  sed -i -e 's/-L\${libjpeg_prefix}\/lib -ljpeg/-ljpeg/' configure
-}
-
-build() {
-  cd ${pkgname}-${pkgver}
-  ./configure --prefix=/usr --with-cairo=system
-
-  make
-}
-
-package() {
-  cd ${pkgname}-${pkgver}
-  make DESTDIR="${pkgdir}" install
-}

Copied: libgdiplus/repos/extra-x86_64/PKGBUILD (from rev 308162, libgdiplus/trunk/PKGBUILD)
===================================================================
--- extra-x86_64/PKGBUILD	                        (rev 0)
+++ extra-x86_64/PKGBUILD	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,30 @@
+# $Id$
+# Maintainer: Daniel Isenmann <daniel at archlinux.org>
+
+pkgname=libgdiplus
+pkgver=4.2
+pkgrel=2
+pkgdesc="An Open Source Implementation of the GDI+ API"
+arch=(i686 x86_64)
+license=('MPL' 'LGPL')
+url="http://www.mono-project.com"
+depends=('libtiff' 'cairo' 'giflib' 'glib2' 'libexif')
+source=(http://download.mono-project.com/sources/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+md5sums=('3e68075aa0911d5ebc2b3739e85af0ea')
+
+prepare() {
+  cd ${pkgname}-${pkgver}
+  sed -i -e 's/-L\${libjpeg_prefix}\/lib -ljpeg/-ljpeg/' configure
+}
+
+build() {
+  cd ${pkgname}-${pkgver}
+  ./configure --prefix=/usr --with-cairo=system
+
+  make
+}
+
+package() {
+  cd ${pkgname}-${pkgver}
+  make DESTDIR="${pkgdir}" install
+}

Deleted: extra-x86_64/libgdiplus-2.10.9-freetype25.patch
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,26 +0,0 @@
-commit 180c02e0f2a2016eba8520b456ca929e9dcf03db
-Author: Jo Shields <directhex at apebox.org>
-Date:   Mon Dec 16 09:24:57 2013 +0000
-
-    Use FreeType macros for tttables.h inclusion
-    
-    As of FreeType 2.1.6 (November 2003), using #include to include Freetype libraries directly is not supported.
-    
-    This has come to a head, as in FreeType 2.5.0, the location of headers has been moved around, breaking building of libgdiplus.
-    
-    This slight change uses the "official" way to include the required header file, without breaking building on older versions of the library.
-
-diff --git a/src/gdiplus-private.h b/src/gdiplus-private.h
-index 59edf9e..dfccc02 100644
---- a/src/gdiplus-private.h
-+++ b/src/gdiplus-private.h
-@@ -30,7 +30,8 @@
- #include <stdio.h>
- #include <math.h>
- #include <glib.h>
--#include <freetype/tttables.h>
-+#include <ft2build.h>
-+#include FT_TRUETYPE_TABLES_H
- #include <pthread.h>
- #include <unistd.h>
- 

Copied: libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-freetype25.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-freetype25.patch)
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-freetype25.patch	                        (rev 0)
+++ extra-x86_64/libgdiplus-2.10.9-freetype25.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,26 @@
+commit 180c02e0f2a2016eba8520b456ca929e9dcf03db
+Author: Jo Shields <directhex at apebox.org>
+Date:   Mon Dec 16 09:24:57 2013 +0000
+
+    Use FreeType macros for tttables.h inclusion
+    
+    As of FreeType 2.1.6 (November 2003), using #include to include Freetype libraries directly is not supported.
+    
+    This has come to a head, as in FreeType 2.5.0, the location of headers has been moved around, breaking building of libgdiplus.
+    
+    This slight change uses the "official" way to include the required header file, without breaking building on older versions of the library.
+
+diff --git a/src/gdiplus-private.h b/src/gdiplus-private.h
+index 59edf9e..dfccc02 100644
+--- a/src/gdiplus-private.h
++++ b/src/gdiplus-private.h
+@@ -30,7 +30,8 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <freetype/tttables.h>
++#include <ft2build.h>
++#include FT_TRUETYPE_TABLES_H
+ #include <pthread.h>
+ #include <unistd.h>
+ 

Deleted: extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,30 +0,0 @@
-diff -rupN a/src/gifcodec.c b/src/gifcodec.c
---- a/src/gifcodec.c	2011-12-02 18:23:12.000000000 +0100
-+++ b/src/gifcodec.c	2014-06-01 13:20:17.027203704 +0200
-@@ -581,7 +581,7 @@ gdip_load_gif_image (void *stream, GpIma
- 	}
- 
- 	FreeExtensionMono(&global_extensions);
--	DGifCloseFile (gif);
-+	DGifCloseFile (gif, NULL);
- 
- 	*image = result;
- 	return Ok;
-@@ -597,7 +597,7 @@ error:
- 
- 	if (gif != NULL) {
- 		FreeExtensionMono (&global_extensions);
--		DGifCloseFile (gif);
-+		DGifCloseFile (gif, NULL);
- 	}
- 
- 	*image = NULL;
-@@ -923,7 +923,7 @@ gdip_save_gif_image (void *stream, GpIma
- 		}
- 	}
- 
--	EGifCloseFile (fp);	
-+	EGifCloseFile (fp, NULL);	
- 	
- 	return Ok;
- 

Copied: libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-giflib-5.1.0.patch)
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch	                        (rev 0)
+++ extra-x86_64/libgdiplus-2.10.9-giflib-5.1.0.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,30 @@
+diff -rupN a/src/gifcodec.c b/src/gifcodec.c
+--- a/src/gifcodec.c	2011-12-02 18:23:12.000000000 +0100
++++ b/src/gifcodec.c	2014-06-01 13:20:17.027203704 +0200
+@@ -581,7 +581,7 @@ gdip_load_gif_image (void *stream, GpIma
+ 	}
+ 
+ 	FreeExtensionMono(&global_extensions);
+-	DGifCloseFile (gif);
++	DGifCloseFile (gif, NULL);
+ 
+ 	*image = result;
+ 	return Ok;
+@@ -597,7 +597,7 @@ error:
+ 
+ 	if (gif != NULL) {
+ 		FreeExtensionMono (&global_extensions);
+-		DGifCloseFile (gif);
++		DGifCloseFile (gif, NULL);
+ 	}
+ 
+ 	*image = NULL;
+@@ -923,7 +923,7 @@ gdip_save_gif_image (void *stream, GpIma
+ 		}
+ 	}
+ 
+-	EGifCloseFile (fp);	
++	EGifCloseFile (fp, NULL);	
+ 	
+ 	return Ok;
+ 

Deleted: extra-x86_64/libgdiplus-2.10.9-gold.patch
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,16 +0,0 @@
- tests/Makefile.in |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/tests/Makefile.in b/tests/Makefile.in
-index 97f5f4e..c02ca25 100644
---- a/tests/Makefile.in
-+++ b/tests/Makefile.in
-@@ -228,7 +228,7 @@ DEPS = \
- 	$(top_builddir)/src/libgdiplus.la
- 
- LDADDS = \
--	$(top_builddir)/src/libgdiplus.la
-+	$(top_builddir)/src/libgdiplus.la -lX11 -lglib-2.0
- 
- testgdi_DEPENDENCIES = $(TEST_DEPS)
- testgdi_LDADD = $(LDADDS)

Copied: libgdiplus/repos/extra-x86_64/libgdiplus-2.10.9-gold.patch (from rev 308162, libgdiplus/trunk/libgdiplus-2.10.9-gold.patch)
===================================================================
--- extra-x86_64/libgdiplus-2.10.9-gold.patch	                        (rev 0)
+++ extra-x86_64/libgdiplus-2.10.9-gold.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,16 @@
+ tests/Makefile.in |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index 97f5f4e..c02ca25 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -228,7 +228,7 @@ DEPS = \
+ 	$(top_builddir)/src/libgdiplus.la
+ 
+ LDADDS = \
+-	$(top_builddir)/src/libgdiplus.la
++	$(top_builddir)/src/libgdiplus.la -lX11 -lglib-2.0
+ 
+ testgdi_DEPENDENCIES = $(TEST_DEPS)
+ testgdi_LDADD = $(LDADDS)

Deleted: extra-x86_64/libgdiplus0-giflib5.patch
===================================================================
--- extra-x86_64/libgdiplus0-giflib5.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/libgdiplus0-giflib5.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,137 +0,0 @@
----
- src/gifcodec.c |   50 +++++++++++++++++++++++++++++++++++++++++---------
- 1 file changed, 41 insertions(+), 9 deletions(-)
-
-Index: libgdiplus-2.10.9/src/gifcodec.c
-===================================================================
---- libgdiplus-2.10.9.orig/src/gifcodec.c
-+++ libgdiplus-2.10.9/src/gifcodec.c
-@@ -105,7 +112,7 @@ gdip_gif_inputfunc (GifFileType *gif, Gi
- */
- 
- static int
--AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
-+AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
- {
- 	ExtensionBlock	*ep;
- 
-@@ -129,7 +136,7 @@ AddExtensionBlockMono(SavedImage *New, i
- 
- 	if (ExtData) {
- 		memcpy(ep->Bytes, ExtData, Len);
--		ep->Function = New->Function;
-+		ep->Function = func;
- 	}
- 
- 	return (GIF_OK);
-@@ -232,20 +239,20 @@ DGifSlurpMono(GifFileType * GifFile, Sav
- 			}
- 
- 			case EXTENSION_RECORD_TYPE: {
--				if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
-+				int func;
-+				if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
- 					return (GIF_ERROR);
- 				}
- 
- 				while (ExtData != NULL) {
- 					/* Create an extension block with our data */
--					if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
-+					if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
- 
- 					if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
- 						return (GIF_ERROR);
- 					}
--					temp_save.Function = 0;
- 				}
- 				break;
- 			}
-@@ -303,12 +310,19 @@ gdip_load_gif_image (void *stream, GpIma
- 	result = NULL;
- 	loop_counter = FALSE;
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
- 	} else {
- 		gif = DGifOpen (stream, &gdip_gif_inputfunc);
- 	}
--	
-+#else
-+	if (from_file)
-+		gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
-+	else
-+		gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
-+#endif
-+
- 	if (gif == NULL) {
- 		goto error;
- 	}
-@@ -581,7 +595,7 @@ gdip_load_gif_image (void *stream, GpIma
- 	}
- 
- 	FreeExtensionMono(&global_extensions);
--	DGifCloseFile (gif);
-+	DGifCloseFile (gif, NULL);
- 
- 	*image = result;
- 	return Ok;
-@@ -597,7 +611,7 @@ error:
- 
- 	if (gif != NULL) {
- 		FreeExtensionMono (&global_extensions);
--		DGifCloseFile (gif);
-+		DGifCloseFile (gif, NULL);
- 	}
- 
- 	*image = NULL;
-@@ -660,11 +674,22 @@ gdip_save_gif_image (void *stream, GpIma
- 		return InvalidParameter;
- 	}
- 
-+#if GIFLIB_MAJOR < 5
- 	if (from_file) {
- 		fp = EGifOpenFileName (stream, 0);
- 	} else {
- 		fp = EGifOpen (stream, gdip_gif_outputfunc);
- 	}
-+#else
-+	if (from_file)
-+		fp = EGifOpenFileName (stream, 0, NULL);
-+	else
-+		fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
-+#define MakeMapObject  GifMakeMapObject
-+#define FreeMapObject  GifFreeMapObject
-+#define QuantizeBuffer GifQuantizeBuffer
-+#define BitSize        GifBitSize
-+#endif
- 		
- 	if (!fp) {
- 		return FileNotFound;
-@@ -848,8 +873,15 @@ gdip_save_gif_image (void *stream, GpIma
- 						Buffer[0] = 1;
- 						Buffer[1] = ptr[0];
- 						Buffer[2] = ptr[1];
-+#if GIFLIB_MAJOR < 5
- 						EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
- 						EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
-+#else
-+						EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
-+						EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
-+						EGifPutExtensionBlock(fp, 3, Buffer);
-+						EGifPutExtensionTrailer(fp);
-+#endif
- 					}
- 				}
- 
-@@ -923,7 +955,7 @@ gdip_save_gif_image (void *stream, GpIma
- 		}
- 	}
- 
--	EGifCloseFile (fp);	
-+	EGifCloseFile (fp, NULL);
- 	
- 	return Ok;
- 

Copied: libgdiplus/repos/extra-x86_64/libgdiplus0-giflib5.patch (from rev 308162, libgdiplus/trunk/libgdiplus0-giflib5.patch)
===================================================================
--- extra-x86_64/libgdiplus0-giflib5.patch	                        (rev 0)
+++ extra-x86_64/libgdiplus0-giflib5.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,137 @@
+---
+ src/gifcodec.c |   50 +++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 41 insertions(+), 9 deletions(-)
+
+Index: libgdiplus-2.10.9/src/gifcodec.c
+===================================================================
+--- libgdiplus-2.10.9.orig/src/gifcodec.c
++++ libgdiplus-2.10.9/src/gifcodec.c
+@@ -105,7 +112,7 @@ gdip_gif_inputfunc (GifFileType *gif, Gi
+ */
+ 
+ static int
+-AddExtensionBlockMono(SavedImage *New, int Len, BYTE ExtData[])
++AddExtensionBlockMono(SavedImage *New, int Len, int func, BYTE ExtData[])
+ {
+ 	ExtensionBlock	*ep;
+ 
+@@ -129,7 +136,7 @@ AddExtensionBlockMono(SavedImage *New, i
+ 
+ 	if (ExtData) {
+ 		memcpy(ep->Bytes, ExtData, Len);
+-		ep->Function = New->Function;
++		ep->Function = func;
+ 	}
+ 
+ 	return (GIF_OK);
+@@ -232,20 +239,20 @@ DGifSlurpMono(GifFileType * GifFile, Sav
+ 			}
+ 
+ 			case EXTENSION_RECORD_TYPE: {
+-				if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) {
++				int func;
++				if (DGifGetExtension(GifFile, &func, &ExtData) == GIF_ERROR) {
+ 					return (GIF_ERROR);
+ 				}
+ 
+ 				while (ExtData != NULL) {
+ 					/* Create an extension block with our data */
+-					if (AddExtensionBlockMono(&temp_save, ExtData[0], &ExtData[1]) == GIF_ERROR) {
++					if (AddExtensionBlockMono(&temp_save, func, ExtData[0], &ExtData[1]) == GIF_ERROR) {
+ 						return (GIF_ERROR);
+ 					}
+ 
+ 					if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) {
+ 						return (GIF_ERROR);
+ 					}
+-					temp_save.Function = 0;
+ 				}
+ 				break;
+ 			}
+@@ -303,12 +310,19 @@ gdip_load_gif_image (void *stream, GpIma
+ 	result = NULL;
+ 	loop_counter = FALSE;
+ 
++#if GIFLIB_MAJOR < 5
+ 	if (from_file) {
+ 		gif = DGifOpen(stream, &gdip_gif_fileinputfunc);
+ 	} else {
+ 		gif = DGifOpen (stream, &gdip_gif_inputfunc);
+ 	}
+-	
++#else
++	if (from_file)
++		gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL);
++	else
++		gif = DGifOpen(stream, &gdip_gif_inputfunc, NULL);
++#endif
++
+ 	if (gif == NULL) {
+ 		goto error;
+ 	}
+@@ -581,7 +595,7 @@ gdip_load_gif_image (void *stream, GpIma
+ 	}
+ 
+ 	FreeExtensionMono(&global_extensions);
+-	DGifCloseFile (gif);
++	DGifCloseFile (gif, NULL);
+ 
+ 	*image = result;
+ 	return Ok;
+@@ -597,7 +611,7 @@ error:
+ 
+ 	if (gif != NULL) {
+ 		FreeExtensionMono (&global_extensions);
+-		DGifCloseFile (gif);
++		DGifCloseFile (gif, NULL);
+ 	}
+ 
+ 	*image = NULL;
+@@ -660,11 +674,22 @@ gdip_save_gif_image (void *stream, GpIma
+ 		return InvalidParameter;
+ 	}
+ 
++#if GIFLIB_MAJOR < 5
+ 	if (from_file) {
+ 		fp = EGifOpenFileName (stream, 0);
+ 	} else {
+ 		fp = EGifOpen (stream, gdip_gif_outputfunc);
+ 	}
++#else
++	if (from_file)
++		fp = EGifOpenFileName (stream, 0, NULL);
++	else
++		fp = EGifOpen (stream, gdip_gif_outputfunc, NULL);
++#define MakeMapObject  GifMakeMapObject
++#define FreeMapObject  GifFreeMapObject
++#define QuantizeBuffer GifQuantizeBuffer
++#define BitSize        GifBitSize
++#endif
+ 		
+ 	if (!fp) {
+ 		return FileNotFound;
+@@ -848,8 +873,15 @@ gdip_save_gif_image (void *stream, GpIma
+ 						Buffer[0] = 1;
+ 						Buffer[1] = ptr[0];
+ 						Buffer[2] = ptr[1];
++#if GIFLIB_MAJOR < 5
+ 						EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0");
+ 						EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer);
++#else
++						EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE);
++						EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0");
++						EGifPutExtensionBlock(fp, 3, Buffer);
++						EGifPutExtensionTrailer(fp);
++#endif
+ 					}
+ 				}
+ 
+@@ -923,7 +955,7 @@ gdip_save_gif_image (void *stream, GpIma
+ 		}
+ 	}
+ 
+-	EGifCloseFile (fp);	
++	EGifCloseFile (fp, NULL);
+ 	
+ 	return Ok;
+ 

Deleted: extra-x86_64/libpng15.patch
===================================================================
--- extra-x86_64/libpng15.patch	2017-10-17 18:01:27 UTC (rev 308162)
+++ extra-x86_64/libpng15.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -1,164 +0,0 @@
-$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
-
-Fix build with png-1.5.
-
---- src/pngcodec.c.orig	2010-11-03 16:52:54.000000000 +0000
-+++ src/pngcodec.c
-@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
- 	bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
- 	bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
- #elif defined(PNG_pHYs_SUPPORTED)
--	if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
--		bitmap_data->image_flags |= ImageFlagsHasRealDPI;
--		bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
--		bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
-+	if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
-+		png_uint_32 res_x, res_y;
-+		int unit_type;
-+		png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
-+		if (unit_type == PNG_RESOLUTION_METER) {
-+			bitmap_data->image_flags |= ImageFlagsHasRealDPI;
-+			bitmap_data->dpi_horz = res_x * 0.0254;
-+			bitmap_data->dpi_vert = res_y * 0.0254;
-+		}
- 	}
- #endif
- 	/* default to screen resolution (if nothing was provided or available) */
-@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
- #if defined(PNG_iCCP_SUPPORTED)
- 	{
- 		png_charp	name;
--		png_charp	profile;
-+		png_bytep	profile;
- 		png_uint_32	proflen;
- 		int		compression_type;
- 
-@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream 
- 		ImageFlags	colourspace_flag;
- 		int		i;
- 		int		j;
-+		png_colorp	png_palette;
-+		int		png_num_palette;
-+		png_bytep	trans_alpha;
-+		int		num_trans;
-+		png_color_16p	trans_color;
- 
- 		width = png_get_image_width (png_ptr, info_ptr);
- 		height = png_get_image_height (png_ptr, info_ptr);
-@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream 
- 		}
- 
- 		/* Copy palette. */
-+		png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
-+
- 		num_colours = 1 << bit_depth;
- 
- 		if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
-@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream 
- 			colourspace_flag = ImageFlagsColorSpaceRGB;
- 
- 			palette_entries = num_colours;
--			if (palette_entries > info_ptr->num_palette) {
--				palette_entries = info_ptr->num_palette;
-+			if (palette_entries > png_num_palette) {
-+				palette_entries = png_num_palette;
- 			}
- 
- 			palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
-@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream 
- 
- 			for (i=0; i < palette_entries; i++) {
- 				set_pixel_bgra (&palette->Entries[i], 0,
--						info_ptr->palette[i].blue,
--						info_ptr->palette[i].green,
--						info_ptr->palette[i].red,
-+						png_palette[i].blue,
-+						png_palette[i].green,
-+						png_palette[i].red,
- 						0xFF); /* alpha */
- 			}
- 		}
- 
-+		png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
- 		/* Make sure transparency is respected. */
--		if (info_ptr->num_trans > 0) {
-+		if (num_trans > 0) {
- 			palette->Flags |= PaletteFlagsHasAlpha;
- 			colourspace_flag |= ImageFlagsHasAlpha;
- 
--			if (info_ptr->num_trans > info_ptr->num_palette) {
--				info_ptr->num_trans = info_ptr->num_palette;
-+			if (num_trans > png_num_palette) {
-+				num_trans = png_num_palette;
- 			}
- 
--			for (i=0; i < info_ptr->num_trans; i++) {
-+			for (i=0; i < num_trans; i++) {
- 				set_pixel_bgra(&palette->Entries[i], 0,
--						info_ptr->palette[i].blue,
--						info_ptr->palette[i].green,
--						info_ptr->palette[i].red,
-+						png_palette[i].blue,
-+						png_palette[i].green,
-+						png_palette[i].red,
- #if PNG_LIBPNG_VER > 10399
--						info_ptr->trans_alpha [i]); /* alpha */
-+						trans_alpha [i]); /* alpha */
- #else
- 						info_ptr->trans[i]); /* alpha */
- #endif
-@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream 
- 		BYTE		bit_depth;
- 		int		stride;
- 		int		interlace;
-+		png_colorp	png_palette;
-+		int		png_num_palette;
- 		png_bytep *row_pointers;
- 		BYTE *rawptr;
- 		int i, j;
-@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream 
- 							png_byte palette = 0;
- 							png_byte pix = *rowp++;
- 
-+							png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
- 							palette = (pix >> 6) & 0x03;
- 							set_pixel_bgra (rawptr, 0,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = (pix >> 4) & 0x03;
- 							set_pixel_bgra (rawptr, 4,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = (pix >> 2) & 0x03;
- 							set_pixel_bgra (rawptr, 8,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 
- 							palette = pix & 0x03;
- 							set_pixel_bgra (rawptr, 12,
--								info_ptr->palette[palette].blue,
--								info_ptr->palette[palette].green,
--								info_ptr->palette[palette].red,
-+								png_palette[palette].blue,
-+								png_palette[palette].green,
-+								png_palette[palette].red,
- 								0xFF); /* alpha */
- 							rawptr += 16;
- 						}

Copied: libgdiplus/repos/extra-x86_64/libpng15.patch (from rev 308162, libgdiplus/trunk/libpng15.patch)
===================================================================
--- extra-x86_64/libpng15.patch	                        (rev 0)
+++ extra-x86_64/libpng15.patch	2017-10-17 18:01:56 UTC (rev 308163)
@@ -0,0 +1,164 @@
+$NetBSD: patch-aa,v 1.8 2011/01/21 10:21:51 wiz Exp $
+
+Fix build with png-1.5.
+
+--- src/pngcodec.c.orig	2010-11-03 16:52:54.000000000 +0000
++++ src/pngcodec.c
+@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp pn
+ 	bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr);
+ 	bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr);
+ #elif defined(PNG_pHYs_SUPPORTED)
+-	if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) {
+-		bitmap_data->image_flags |= ImageFlagsHasRealDPI;
+-		bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254;
+-		bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254;
++	if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) {
++		png_uint_32 res_x, res_y;
++		int unit_type;
++		png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type);
++		if (unit_type == PNG_RESOLUTION_METER) {
++			bitmap_data->image_flags |= ImageFlagsHasRealDPI;
++			bitmap_data->dpi_horz = res_x * 0.0254;
++			bitmap_data->dpi_vert = res_y * 0.0254;
++		}
+ 	}
+ #endif
+ 	/* default to screen resolution (if nothing was provided or available) */
+@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp pn
+ #if defined(PNG_iCCP_SUPPORTED)
+ 	{
+ 		png_charp	name;
+-		png_charp	profile;
++		png_bytep	profile;
+ 		png_uint_32	proflen;
+ 		int		compression_type;
+ 
+@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream 
+ 		ImageFlags	colourspace_flag;
+ 		int		i;
+ 		int		j;
++		png_colorp	png_palette;
++		int		png_num_palette;
++		png_bytep	trans_alpha;
++		int		num_trans;
++		png_color_16p	trans_color;
+ 
+ 		width = png_get_image_width (png_ptr, info_ptr);
+ 		height = png_get_image_height (png_ptr, info_ptr);
+@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream 
+ 		}
+ 
+ 		/* Copy palette. */
++		png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
++
+ 		num_colours = 1 << bit_depth;
+ 
+ 		if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) {
+@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream 
+ 			colourspace_flag = ImageFlagsColorSpaceRGB;
+ 
+ 			palette_entries = num_colours;
+-			if (palette_entries > info_ptr->num_palette) {
+-				palette_entries = info_ptr->num_palette;
++			if (palette_entries > png_num_palette) {
++				palette_entries = png_num_palette;
+ 			}
+ 
+ 			palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB));
+@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream 
+ 
+ 			for (i=0; i < palette_entries; i++) {
+ 				set_pixel_bgra (&palette->Entries[i], 0,
+-						info_ptr->palette[i].blue,
+-						info_ptr->palette[i].green,
+-						info_ptr->palette[i].red,
++						png_palette[i].blue,
++						png_palette[i].green,
++						png_palette[i].red,
+ 						0xFF); /* alpha */
+ 			}
+ 		}
+ 
++		png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color);
+ 		/* Make sure transparency is respected. */
+-		if (info_ptr->num_trans > 0) {
++		if (num_trans > 0) {
+ 			palette->Flags |= PaletteFlagsHasAlpha;
+ 			colourspace_flag |= ImageFlagsHasAlpha;
+ 
+-			if (info_ptr->num_trans > info_ptr->num_palette) {
+-				info_ptr->num_trans = info_ptr->num_palette;
++			if (num_trans > png_num_palette) {
++				num_trans = png_num_palette;
+ 			}
+ 
+-			for (i=0; i < info_ptr->num_trans; i++) {
++			for (i=0; i < num_trans; i++) {
+ 				set_pixel_bgra(&palette->Entries[i], 0,
+-						info_ptr->palette[i].blue,
+-						info_ptr->palette[i].green,
+-						info_ptr->palette[i].red,
++						png_palette[i].blue,
++						png_palette[i].green,
++						png_palette[i].red,
+ #if PNG_LIBPNG_VER > 10399
+-						info_ptr->trans_alpha [i]); /* alpha */
++						trans_alpha [i]); /* alpha */
+ #else
+ 						info_ptr->trans[i]); /* alpha */
+ #endif
+@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream 
+ 		BYTE		bit_depth;
+ 		int		stride;
+ 		int		interlace;
++		png_colorp	png_palette;
++		int		png_num_palette;
+ 		png_bytep *row_pointers;
+ 		BYTE *rawptr;
+ 		int i, j;
+@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream 
+ 							png_byte palette = 0;
+ 							png_byte pix = *rowp++;
+ 
++							png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette);
+ 							palette = (pix >> 6) & 0x03;
+ 							set_pixel_bgra (rawptr, 0,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = (pix >> 4) & 0x03;
+ 							set_pixel_bgra (rawptr, 4,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = (pix >> 2) & 0x03;
+ 							set_pixel_bgra (rawptr, 8,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 
+ 							palette = pix & 0x03;
+ 							set_pixel_bgra (rawptr, 12,
+-								info_ptr->palette[palette].blue,
+-								info_ptr->palette[palette].green,
+-								info_ptr->palette[palette].red,
++								png_palette[palette].blue,
++								png_palette[palette].green,
++								png_palette[palette].red,
+ 								0xFF); /* alpha */
+ 							rawptr += 16;
+ 						}



More information about the arch-commits mailing list