mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-25 21:06:24 +02:00
add options to flip horizontally and vertically
This commit is contained in:
parent
d506fc6881
commit
a039c1bbca
4 changed files with 36 additions and 10 deletions
12
data/data.go
12
data/data.go
|
|
@ -35,6 +35,9 @@ type Options struct {
|
|||
|
||||
// Rotate image the specified degrees counter-clockwise. Valid values are 90, 180, 270.
|
||||
Rotate int
|
||||
|
||||
FlipVertical bool
|
||||
FlipHorizontal bool
|
||||
}
|
||||
|
||||
func (o Options) String() string {
|
||||
|
|
@ -68,6 +71,15 @@ func ParseOptions(str string) *Options {
|
|||
o.Fit = true
|
||||
continue
|
||||
}
|
||||
if part == "fv" {
|
||||
o.FlipVertical = true
|
||||
continue
|
||||
}
|
||||
if part == "fh" {
|
||||
o.FlipHorizontal = true
|
||||
continue
|
||||
}
|
||||
|
||||
if len(part) > 2 && strings.HasPrefix(part, "r=") {
|
||||
o.Rotate, _ = strconv.Atoi(part[2:])
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue