diff --git a/util.go b/util.go index 1999a1fd35ebb6a9a049d6c9c95cefe5494e75f2..f84628b58159b3999787810bf96a3fc4c3001e02 100644 --- a/util.go +++ b/util.go @@ -96,7 +96,14 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size, } mw.StripImage() - mw.SetImageColorspace(colorSpace) + iccProfile := wand.GetImageProfile("ICC") + if iccProfile != "" { + mw.SetImageProfile("ICC", []byte(iccProfile)) + } + iptcProfile := wand.GetImageProfile("IPTC") + if iptcProfile != "" { + mw.SetImageProfile("IPTC", []byte(iptcProfile)) + } err = mw.WriteImage(target)