diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-08-17 17:19:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 17:19:06 -0700 |
commit | 96eab1202717e073782ec399a4e0820cae15b1bb (patch) | |
tree | 011012982be971c7e9ef91466f026bc0956ac9a2 /vendor/github.com/disintegration/imaging/transform.go | |
parent | 2c895ee66eed626721135acfcc48254c6e3f3b29 (diff) | |
download | chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.gz chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.bz2 chat-96eab1202717e073782ec399a4e0820cae15b1bb.zip |
Updating server dependancies. (#7246)
Diffstat (limited to 'vendor/github.com/disintegration/imaging/transform.go')
-rw-r--r-- | vendor/github.com/disintegration/imaging/transform.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/disintegration/imaging/transform.go b/vendor/github.com/disintegration/imaging/transform.go index 30410c278..43668dfd7 100644 --- a/vendor/github.com/disintegration/imaging/transform.go +++ b/vendor/github.com/disintegration/imaging/transform.go @@ -206,6 +206,19 @@ func Rotate270(img image.Image) *image.NRGBA { // The angle parameter is the rotation angle in degrees. // The bgColor parameter specifies the color of the uncovered zone after the rotation. func Rotate(img image.Image, angle float64, bgColor color.Color) *image.NRGBA { + angle = angle - math.Floor(angle/360)*360 + + switch angle { + case 0: + return Clone(img) + case 90: + return Rotate90(img) + case 180: + return Rotate180(img) + case 270: + return Rotate270(img) + } + src := toNRGBA(img) srcW := src.Bounds().Max.X srcH := src.Bounds().Max.Y |