From: Sven Eckelmann <sven@narfation.org>
Date: Sat, 31 Aug 2019 10:19:26 +0200
Subject: Fix encodeImage/decodeImage bytestring support in Python3

Bug-Debian: https://bugs.debian.org/936493
Forwarded: to public mail without public archive
---
 api/api.hh | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/api/api.hh b/api/api.hh
index d55ca1e..7587569 100644
--- a/api/api.hh
+++ b/api/api.hh
@@ -57,16 +57,10 @@ Image* copyImageCropRotate (Image* image, int x, int y,
 			   unsigned int w, unsigned int h, double angle);
 
 // decode image from memory data of size n
-#if defined(SWIG) && !defined(SWIG_CSTRING_UNIMPL)
+#if defined(SWIG)
 %apply (char *STRING, int LENGTH) { (char *data, int n) };
 #endif
-#if !defined(SWIG) || (defined(SWIG) && !defined(SWIG_CSTRING_UNIMPL))
 bool decodeImage (Image* image, char* data, int n);
-#endif
-
-#if !defined(SWIG) || (defined(SWIG) && defined(SWIG_CSTRING_UNIMPL))
-bool decodeImage (Image* image, const std::string& data);
-#endif
 
 // decode image from given filename
 bool decodeImageFile (Image* image, const char* filename);
@@ -75,18 +69,12 @@ bool decodeImageFile (Image* image, const char* filename);
 // encode image to memory, the data is newly allocated and returned
 // return 0 i the image could not be decoded
 
-#if defined(SWIG) && !defined(SWIG_CSTRING_UNIMPL)
+#if defined(SWIG)
 %cstring_output_allocate_size(char ** s, int *slen, free(*$1))
 #endif
-#if !defined(SWIG) || (defined(SWIG) && !defined(SWIG_CSTRING_UNIMPL))
 void encodeImage (char **s, int *slen,
 		  Image* image, const char* codec, int quality = 75,
 		  const char* compression = "");
-#endif
-#if !defined(SWIG) || (defined(SWIG) && defined(SWIG_CSTRING_UNIMPL))
-const std::string encodeImage (Image* image, const char* codec, int quality = 75,
-                               const char* compression = "");
-#endif
 
 // encode image into specified filename
 bool encodeImageFile (Image* image, const char* filename,
