Commit 4504b7db authored by Bernard Cafarelli's avatar Bernard Cafarelli

Filter tesseract log lines in orientation detection

(for example, OpenCL devices output)
parent c2e48063
......@@ -164,7 +164,7 @@ def detect_orientation(image, lang=None):
output = output.decode("utf-8")
output = output.strip()
output = output.split("\n")
output = [line.split(": ") for line in output]
output = [line.split(": ") for line in output if (": " in line)]
output = {x: y for (x, y) in output}
angle = int(output['Orientation in degrees'])
# Tesseract reports the angle in the opposite direction the one we want
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