if len(corners) == 4:
im = im_orig.copy()
draw = ImageDraw.Draw(im)
- l_vert, l_hor = lines(corners)
+ try:
+ l_vert, l_hor = lines(corners)
+ except Exception:
+ corners = corners[:-1]
for l in l_vert:
draw.line(l, fill=color, width=line_width)
for l in l_hor: