add options to flip horizontally and vertically

This commit is contained in:
Will Norris 2013-12-06 22:18:44 -08:00
parent d506fc6881
commit a039c1bbca
4 changed files with 36 additions and 10 deletions

View file

@ -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