core icon indicating copy to clipboard operation
core copied to clipboard

PAGE validator: handle empty points

Open bertsky opened this issue 3 years ago • 0 comments
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().

bertsky avatar Jun 08 '22 14:06 bertsky