Package org.apache.tika.imageprocessing
Class ByteSizeCheck
java.lang.Object
org.apache.tika.imageprocessing.ByteSizeCheck
- All Implemented Interfaces:
Serializable,ImageCheck
Refuses an image shorter than
minBytes or longer than maxBytes, by its
measured length: the image is not read, so this is the cheapest check to run first. A setting
of 0 turns that limit off, and an image whose length is unknown or only declared is admitted. The reasons
are file-too-small and file-too-large, as the VLM parsers' own byte limits
report them; those limits stay, this one is for any engine.- Since:
- Apache Tika 4.2
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tika.parser.enricher.ImageCheck
ImageCheck.Verdict -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(ImageProbe image, Metadata metadata, ParseContext context) longlongvoidsetMaxBytes(long maxBytes) voidsetMinBytes(long minBytes)
-
Constructor Details
-
ByteSizeCheck
public ByteSizeCheck()
-
-
Method Details
-
check
public ImageCheck.Verdict check(ImageProbe image, Metadata metadata, ParseContext context) throws IOException - Specified by:
checkin interfaceImageCheck- Parameters:
image- the image and what earlier checks have already learned about itmetadata- the metadata of the image the engine would be handedcontext- the parse context- Throws:
IOException
-
getMinBytes
public long getMinBytes() -
setMinBytes
public void setMinBytes(long minBytes) -
getMaxBytes
public long getMaxBytes() -
setMaxBytes
public void setMaxBytes(long maxBytes)
-