Class SizeGatedEnricher

java.lang.Object
org.apache.tika.parser.ParserDecorator
org.apache.tika.parser.enricher.SizeGatedEnricher
All Implemented Interfaces:
Serializable, SelfConfiguring, Parser

public class SizeGatedEnricher extends ParserDecorator
A text-recognizers entry's _min-width/_min-height: an image whose recorded dimensions (tiff:ImageWidth, tiff:ImageLength) fall short in either is not handed to the engine. An image of unknown size is. The engine's own byte gates (minFileSizeToOcr) are unchanged.
Since:
Apache Tika 4.1
See Also:
  • Constructor Details

    • SizeGatedEnricher

      public SizeGatedEnricher(Parser parser, int minWidth, int minHeight)
  • Method Details

    • tooSmall

      public static boolean tooSmall(Metadata metadata, int minWidth, int minHeight)
      True when the metadata records a width or height below the minimum.
    • getMinWidth

      public int getMinWidth()
    • getMinHeight

      public int getMinHeight()
    • parse

      public void parse(TikaInputStream tis, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
      Description copied from class: ParserDecorator
      Delegates the method call to the decorated parser. Subclasses should override this method (and use super.parse() to invoke the decorated parser) to implement extra decoration.
      Specified by:
      parse in interface Parser
      Overrides:
      parse in class ParserDecorator
      Parameters:
      handler - handler for the XHTML SAX events (output)
      metadata - document metadata (input and output)
      context - parse context
      Throws:
      IOException - if the document stream could not be read
      SAXException - if the SAX events could not be processed
      TikaException - if the document could not be parsed
    • getDecorationName

      public String getDecorationName()
      Overrides:
      getDecorationName in class ParserDecorator
      Returns:
      A name/description of the decoration, or null if none available