Commit 34a3c31c authored by Paulo Miguel Almeida's avatar Paulo Miguel Almeida

Avoid unnecessary convert to RGB and allow using image formats different from PNG

parent 0d1e1503
......@@ -150,12 +150,13 @@ def detect_orientation(image, lang=None):
if lang is not None:
command += ['-l', lang]
image = image.convert("RGB")
if image.mode != "RGB":
image = image.convert("RGB")
proc = subprocess.Popen(command, stdin=subprocess.PIPE,
stderr=subprocess.STDOUT), format='png'), format=image.format)
output =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment