Ignore too small images

This commit is contained in:
Dominique Eifländer 2021-02-01 15:14:46 +01:00
parent 0cec88f1b4
commit 39ca191b9c

View File

@ -216,7 +216,9 @@ public class PDFLinesTextStripper extends PDFTextStripper {
Rectangle2D rect = new Rectangle2D.Float((float) imageBounds.getX(), (float) imageBounds.getY(), (float) imageBounds Rectangle2D rect = new Rectangle2D.Float((float) imageBounds.getX(), (float) imageBounds.getY(), (float) imageBounds
.getWidth(), (float) imageBounds.getHeight()); .getWidth(), (float) imageBounds.getHeight());
this.imageBounds.add(rect); if(rect.getHeight() > 2 && rect.getWidth() > 2) {
this.imageBounds.add(rect);
}
} }
} catch (Exception e) { } catch (Exception e) {
log.warn("Problem during image extraction: {}", e.getMessage()); log.warn("Problem during image extraction: {}", e.getMessage());