From 15baca5e080ae228663624ee994ce00bc149e8e6 Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Sun, 28 Apr 2013 14:56:14 +0200 Subject: [PATCH] HocrTransform.py: exist if page size if not found fixes #21 --- src/hocrTransform.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hocrTransform.py b/src/hocrTransform.py index d6a5abe7..7666ec6b 100644 --- a/src/hocrTransform.py +++ b/src/hocrTransform.py @@ -35,12 +35,11 @@ class hocrTransform(): self.width = self.px2pt(coords[2]-coords[0]) self.height = self.px2pt(coords[3]-coords[1]) break # there shouldn't be more than one, and if there is, we don't want it + + # no width and heigh definition in the ocr_image element of the hocr file if self.width is None: - # no width and heigh definition in the ocr_image element of the hocr file - # assuming page size is A4 - print "page width and height not available in %s. Assuming A4."%(imageFileName) - self.width = 21*2.54*inch - self.height = 29.7*2.54*inch + print "No page dimension found in the hocr file" + sys.exit(1) def __str__(self): """