From f62a5448ff0a570d0dbceeaa400b92e471aec149 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Mon, 30 Apr 2018 04:48:40 +0200
Subject: [PATCH] Improve colorspace handling

Signed-off-by: Janne Koschinski <janne@kuschku.de>
---
 util.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/util.go b/util.go
index f84628b..457af7f 100644
--- a/util.go
+++ b/util.go
@@ -18,11 +18,17 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size,
 		defer mw.Destroy()
 
 		colorSpace = mw.GetImageColorspace()
+		if colorSpace == imagick.COLORSPACE_UNDEFINED {
+			colorSpace = imagick.COLORSPACE_SRGB
+		}
 	} else {
 		mw = wandLinear.Clone()
 		defer mw.Destroy()
 
 		colorSpace = mw.GetImageColorspace()
+		if colorSpace == imagick.COLORSPACE_UNDEFINED {
+			colorSpace = imagick.COLORSPACE_SRGB
+		}
 
 		width := mw.GetImageWidth()
 		height := mw.GetImageHeight()
-- 
GitLab