Pull request #113: Ignore too small images

Merge in RED/redaction-service from IgnoreTooSmall to master

* commit '39ca191b9cb5dec5fbb01e8319cbbe361c7cd85e':
  Ignore too small images
This commit is contained in:
Dominique Eiflaender 2021-02-01 15:46:57 +01:00
commit ec4db538a7

View File

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