Class MinImageSizeCheck

java.lang.Object
org.apache.tika.imageprocessing.MinImageSizeCheck
All Implemented Interfaces:
Serializable, ImageCheck

public class MinImageSizeCheck extends Object implements ImageCheck
Refuses an image smaller than minTotalPixels in area, or whose shorter side is under minShortSidePixels, by the dimensions in its header (not the recorded metadata, which not every image has). A strip of 11 x 1000 passes the area test but holds no line of text, hence the side minimum. minWidthPixels and minHeightPixels ask for more of one dimension than minShortSidePixels does (a wide banner may need only a short height); each applies on top of it. A setting of 0 turns that test off; an image of unknown size is admitted.
Since:
Apache Tika 4.2
See Also:
  • Constructor Details

    • MinImageSizeCheck

      public MinImageSizeCheck()
  • Method Details

    • check

      public ImageCheck.Verdict check(ImageProbe image, Metadata metadata, ParseContext context) throws IOException
      Specified by:
      check in interface ImageCheck
      Parameters:
      image - the image and what earlier checks have already learned about it
      metadata - the metadata of the image the engine would be handed
      context - the parse context
      Throws:
      IOException
    • getMinTotalPixels

      public long getMinTotalPixels()
    • setMinTotalPixels

      public void setMinTotalPixels(long minTotalPixels)
    • getMinShortSidePixels

      public int getMinShortSidePixels()
    • setMinShortSidePixels

      public void setMinShortSidePixels(int minShortSidePixels)
    • getMinWidthPixels

      public int getMinWidthPixels()
    • setMinWidthPixels

      public void setMinWidthPixels(int minWidthPixels)
    • getMinHeightPixels

      public int getMinHeightPixels()
    • setMinHeightPixels

      public void setMinHeightPixels(int minHeightPixels)