normalize rotate values

A -90 or 630 degree rotation is the same as 270.
This commit is contained in:
Will Norris 2017-09-06 21:06:52 +00:00
parent 76c8498abe
commit 07c54b46e3
2 changed files with 5 additions and 1 deletions

View file

@ -208,7 +208,8 @@ func transformImage(m image.Image, opt Options) image.Image {
}
// rotate
switch opt.Rotate {
rotate := float64(opt.Rotate) - math.Floor(float64(opt.Rotate)/360)*360
switch rotate {
case 90:
m = imaging.Rotate90(m)
case 180: