Skip to content
Snippets Groups Projects
Verified Commit ff0c49f4 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

More debugging info

parent 91efaf2e
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,58 @@ import ( ...@@ -7,6 +7,58 @@ import (
"math" "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, size Size, quality Quality, target string) error { func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size, quality Quality, target string) error {
var err error var err error
var mw *imagick.MagickWand var mw *imagick.MagickWand
...@@ -86,7 +138,6 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size, ...@@ -86,7 +138,6 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size,
return err return err
} }
println(colorSpace)
err = mw.TransformImageColorspace(colorSpace) err = mw.TransformImageColorspace(colorSpace)
if err != nil { if err != nil {
return err return err
...@@ -112,6 +163,7 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size, ...@@ -112,6 +163,7 @@ func resize(wand *imagick.MagickWand, wandLinear *imagick.MagickWand, size Size,
mw.SetImageProfile("IPTC", []byte(iptcProfile)) mw.SetImageProfile("IPTC", []byte(iptcProfile))
} }
println(colorSpaceName(colorSpace))
err = mw.WriteImage(target) err = mw.WriteImage(target)
return err return err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment