File sk1-ImageMagick7.patch of Package sk1

Index: sk1-2.0rc2/src/uc2/libimg/_libimg.c
===================================================================
--- sk1-2.0rc2.orig/src/uc2/libimg/_libimg.c	2016-10-09 12:40:45.000000000 +0200
+++ sk1-2.0rc2/src/uc2/libimg/_libimg.c	2017-03-27 16:07:18.725664504 +0200
@@ -199,15 +199,15 @@ im_NextImage(PyObject *self, PyObject *a
 //	  UndefinedType,
 //	  BilevelType,
 //	  GrayscaleType,
-//	  GrayscaleMatteType,
+//	  GrayscaleMatteType (GrayscaleAlphaType for ImageMagick7),
 //	  PaletteType,
-//	  PaletteMatteType,
+//	  PaletteMatteType (PaletteAlphaType for ImageMagick7),
 //	  TrueColorType,
-//	  TrueColorMatteType,
+//	  TrueColorMatteType (TrueColorAlphaType for ImageMagick7),
 //	  ColorSeparationType,
-//	  ColorSeparationMatteType,
+//	  ColorSeparationMatteType (ColorSeparationAlphaType for ImageMagick7),
 //	  OptimizeType,
-//	  PaletteBilevelMatteType
+//	  PaletteBilevelMatteType (PaletteBilevelAlphaType for ImageMagick7)
 
 static PyObject *
 im_GetImageType(PyObject *self, PyObject *args) {
@@ -230,32 +230,52 @@ im_GetImageType(PyObject *self, PyObject
 	else if (img_type == GrayscaleType){
 		return Py_BuildValue("s", "GrayscaleType");
 	}
+#if MagickLibVersion >= 0x700
+	else if (img_type == GrayscaleAlphaType){
+#else
 	else if (img_type == GrayscaleMatteType){
-		return Py_BuildValue("s", "GrayscaleMatteType");
+#endif
+		return Py_BuildValue("s", "GrayscaleAlphaType");
 	}
 	else if (img_type == PaletteType){
 		return Py_BuildValue("s", "PaletteType");
 	}
+#if MagickLibVersion >= 0x700
+	else if (img_type == PaletteAlphaType){
+#else
 	else if (img_type == PaletteMatteType){
-		return Py_BuildValue("s", "PaletteMatteType");
+#endif
+		return Py_BuildValue("s", "PaletteAlphaType");
 	}
 	else if (img_type == TrueColorType){
 		return Py_BuildValue("s", "TrueColorType");
 	}
+#if MagickLibVersion >= 0x700
+	else if (img_type == TrueColorAlphaType){
+#else
 	else if (img_type == TrueColorMatteType){
-		return Py_BuildValue("s", "TrueColorMatteType");
+#endif
+		return Py_BuildValue("s", "TrueColorAlphaType");
 	}
 	else if (img_type == ColorSeparationType){
 		return Py_BuildValue("s", "ColorSeparationType");
 	}
+#if MagickLibVersion >= 0x700
+	else if (img_type == ColorSeparationAlphaType){
+#else
 	else if (img_type == ColorSeparationMatteType){
-		return Py_BuildValue("s", "ColorSeparationMatteType");
+#endif
+		return Py_BuildValue("s", "ColorSeparationAlphaType");
 	}
 	else if (img_type == OptimizeType){
 		return Py_BuildValue("s", "OptimizeType");
 	}
+#if MagickLibVersion >= 0x700
+	else if (img_type == PaletteBilevelAlphaType){
+#else
 	else if (img_type == PaletteBilevelMatteType){
-		return Py_BuildValue("s", "PaletteBilevelMatteType");
+#endif
+		return Py_BuildValue("s", "PaletteBilevelAlphaType");
 	}
 	else {
 		return Py_BuildValue("s", "UndefinedType");
@@ -281,9 +301,9 @@ im_GetImageType(PyObject *self, PyObject
 //HSBColorspace,
 //HSLColorspace,
 //HWBColorspace,
-//Rec601LumaColorspace,
+//Rec601LumaColorspace (only in ImageMagick <= 6),
 //Rec601YCbCrColorspace,
-//Rec709LumaColorspace,
+//Rec709LumaColorspace (only in ImageMagick <= 6),
 //Rec709YCbCrColorspace,
 //LogColorspace,
 //CMYColorspace
@@ -351,15 +371,19 @@ im_GetColorspace(PyObject *self, PyObjec
 	else if (cs == HWBColorspace){
 		return Py_BuildValue("s", "HWBColorspace");
 	}
+#if MagickLibVersion < 0x700
 	else if (cs == Rec601LumaColorspace){
 		return Py_BuildValue("s", "Rec601LumaColorspace");
 	}
+#endif
 	else if (cs == Rec601YCbCrColorspace){
 		return Py_BuildValue("s", "Rec601YCbCrColorspace");
 	}
+#if MagickLibVersion < 0x700
 	else if (cs == Rec709LumaColorspace){
 		return Py_BuildValue("s", "Rec709LumaColorspace");
 	}
+#endif
 	else if (cs == Rec709YCbCrColorspace){
 		return Py_BuildValue("s", "Rec709YCbCrColorspace");
 	}
@@ -426,25 +450,41 @@ get_image_type(char* mode) {
     return GrayscaleType;
   }
   else if (strcmp(mode, "GrayscaleMatteType") == 0) {
+#if MagickLibVersion >= 0x700
+    return GrayscaleAlphaType;
+#else
     return GrayscaleMatteType;
+#endif
   }
   else if (strcmp(mode, "PaletteType") == 0) {
     return PaletteType;
   }
-  else if (strcmp(mode, "PaletteMatteType") == 0) {
+  else if (strcmp(mode, "PaletteAlphaType") == 0) {
+#if MagickLibVersion >= 0x700
+    return PaletteAlphaType;
+#else
     return PaletteMatteType;
+#endif
   }
   else if (strcmp(mode, "TrueColorType") == 0) {
     return TrueColorType;
   }
-  else if (strcmp(mode, "TrueColorMatteType") == 0) {
+  else if (strcmp(mode, "TrueColorAlphaType") == 0) {
+#if MagickLibVersion >= 0x700
+    return TrueColorAlphaType;
+#else
     return TrueColorMatteType;
+#endif
   }
   else if (strcmp(mode, "ColorSeparationType") == 0) {
     return ColorSeparationType;
   }
   else if (strcmp(mode, "ColorSeparationMatteType") == 0) {
+#if MagickLibVersion >= 0x700
+    return ColorSeparationAlphaType;
+#else
     return ColorSeparationMatteType;
+#endif
   }
   else {
     return TrueColorType;
Index: sk1-2.0rc2/src/uc2/libimg/magickwand.py
===================================================================
--- sk1-2.0rc2.orig/src/uc2/libimg/magickwand.py	2016-10-09 12:40:45.000000000 +0200
+++ sk1-2.0rc2/src/uc2/libimg/magickwand.py	2017-03-27 16:03:39.189632867 +0200
@@ -19,13 +19,13 @@ from cStringIO import StringIO
 
 BILEVEL_TYPE = 'BilevelType'
 L_TYPE = 'GrayscaleType'
-LA_TYPE = 'GrayscaleMatteType'
+LA_TYPE = 'GrayscaleAlphaType'
 P_TYPE = 'PaletteType'
-PA_TYPE = 'PaletteMatteType'
+PA_TYPE = 'PaletteAlphaType'
 RGB_TYPE = 'TrueColorType'
-RGBA_TYPE = 'TrueColorMatteType'
+RGBA_TYPE = 'TrueColorAlphaType'
 CMYK_TYPE = 'ColorSeparationType'
-CMYKA_TYPE = 'ColorSeparationMatteType'
+CMYKA_TYPE = 'ColorSeparationAlphaType'
 
 WAND_TYPES = [BILEVEL_TYPE, L_TYPE, LA_TYPE, P_TYPE, PA_TYPE,
 			RGB_TYPE, RGBA_TYPE, CMYK_TYPE, CMYKA_TYPE, ]