diff --git a/main.go b/main.go index 3e4df0892e2a9bf869c11877ff6171f0943c64f3..24391d46cb91244555b7c25dac40572a7cf633c9 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,6 @@ func processImage(config *Config, client *redis.Client, value string) { if colorSpace == imagick.COLORSPACE_UNDEFINED { colorSpace = imagick.COLORSPACE_SRGB } - println(colorSpaceName(colorSpace)) err = wandLinear.TransformImageColorspace(imagick.COLORSPACE_RGB) if err != nil { diff --git a/util.go b/util.go index d8939c7ad963ca4ff52f45b36b507741093da9b6..9cb4d783694c03de451d5985087bf3095aba14e0 100644 --- a/util.go +++ b/util.go @@ -7,58 +7,6 @@ import ( "math" ) -func colorSpaceName(colorSpace imagick.ColorspaceType) string { - if colorSpace == imagick.COLORSPACE_UNDEFINED { - return "COLORSPACE_UNDEFINED" - } else if colorSpace == imagick.COLORSPACE_RGB { - return "COLORSPACE_RGB" - } else if colorSpace == imagick.COLORSPACE_GRAY { - return "COLORSPACE_GRAY" - } else if colorSpace == imagick.COLORSPACE_TRANSPARENT { - return "COLORSPACE_TRANSPARENT" - } else if colorSpace == imagick.COLORSPACE_OHTA { - return "COLORSPACE_OHTA" - } else if colorSpace == imagick.COLORSPACE_LAB { - return "COLORSPACE_LAB" - } else if colorSpace == imagick.COLORSPACE_XYZ { - return "COLORSPACE_XYZ" - } else if colorSpace == imagick.COLORSPACE_YCBCR { - return "COLORSPACE_YCBCR" - } else if colorSpace == imagick.COLORSPACE_YCC { - return "COLORSPACE_YCC" - } else if colorSpace == imagick.COLORSPACE_YIQ { - return "COLORSPACE_YIQ" - } else if colorSpace == imagick.COLORSPACE_YPBPR { - return "COLORSPACE_YPBPR" - } else if colorSpace == imagick.COLORSPACE_YUV { - return "COLORSPACE_YUV" - } else if colorSpace == imagick.COLORSPACE_CMYK { - return "COLORSPACE_CMYK" - } else if colorSpace == imagick.COLORSPACE_SRGB { - return "COLORSPACE_SRGB" - } else if colorSpace == imagick.COLORSPACE_HSB { - return "COLORSPACE_HSB" - } else if colorSpace == imagick.COLORSPACE_HSL { - return "COLORSPACE_HSL" - } else if colorSpace == imagick.COLORSPACE_HWB { - return "COLORSPACE_HWB" - } else if colorSpace == imagick.COLORSPACE_REC601LUMA { - return "COLORSPACE_REC601LUMA" - } else if colorSpace == imagick.COLORSPACE_REC601YCBCR { - return "COLORSPACE_REC601YCBCR" - } else if colorSpace == imagick.COLORSPACE_REC709LUMA { - return "COLORSPACE_REC709LUMA" - } else if colorSpace == imagick.COLORSPACE_REC709YCBCR { - return "COLORSPACE_REC709YCBCR" - } else if colorSpace == imagick.COLORSPACE_LOG { - return "COLORSPACE_LOG" - } else if colorSpace == imagick.COLORSPACE_CMY { - return "COLORSPACE_CMY" - } else { - return "Unknown" - } -} - func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, originalColorSpace imagick.ColorspaceType, size Size, quality Quality, target string) error { var err error var mw *imagick.MagickWand @@ -142,15 +90,6 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, originalCo } mw.StripImage() - 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) return err