- options["mode"] = "%sx%s" % (match["height"], match["width"])
- if match["rotate"] != "normal":
- options["rotate"] = match["rotate"]
- if "reflect" in match:
- if match["reflect"] == "X":
- options["reflect"] = "x"
- elif match["reflect"] == "Y":
- options["reflect"] = "y"
- elif match["reflect"] == "X and Y":
- options["reflect"] = "xy"
+ if match["rotate"] not in ("left", "right"):
+ options["mode"] = "%sx%s" % (match["width"], match["height"])
+ else:
+ options["mode"] = "%sx%s" % (match["height"], match["width"])
+ options["rotate"] = match["rotate"]
+ if match["primary"]:
+ options["primary"] = None
+ if match["reflect"] == "X":
+ options["reflect"] = "x"
+ elif match["reflect"] == "Y":
+ options["reflect"] = "y"
+ elif match["reflect"] == "X and Y":
+ options["reflect"] = "xy"