core
core copied to clipboard
PAGE validator: handle empty points
trafficstars
Currently when there is a @points="" the validator crashes:
File "ocrd_validators/page_validator.py", line 274, in validate_consistency
node_poly = make_poly(polygon_from_points(parent_points))
File "ocrd_utils/image.py", line 148, in polygon_from_points
polygon.append([float(x_y[0]), float(x_y[1])])
ValueError: could not convert string to float:
We should be more robust. To make the CoordinateValidityError usable, we could instantiate an empty Polygon().