mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-24 20:36:24 +02:00
normalize rotate values
A -90 or 630 degree rotation is the same as 270.
This commit is contained in:
parent
76c8498abe
commit
07c54b46e3
2 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue