Class ImageTransformerConfig
- All Implemented Interfaces:
Labelable
Transforms an image using common image operations.
This class should only be used as a pre-parsing handler, on image files.
It may also be appropriate to disable parsing of those images if you
want to keep the transformed version intact. This can be done by
configuring DefaultParser
as a handler in the ImporterConfig.
Content-types
By default, this filter is restricted to (applies only to) documents matching
the restrictions returned by
CommonRestrictions.imageIOStandardContentTypes(String).
You can specify your own content types if you know they represent a supported
image.
Image dimension format
For a list of supported image dimension formats, refer to
DimensionConverter.
Usage example:
The above example converts images to PNG while scaling it to a maximum dimension of 400 pixels wide and 250 pixel high.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe matcher of content types to apply transformation on.getCrop()getScale()inthashCode()setContentTypeMatcher(TextMatcher contentTypeMatcher) The matcher of content types to apply transformation on.setRotation(Double rotation) setTargetFormat(String targetFormat) toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Field Details
-
DEFAULT_TARGET_FORMAT
- See Also:
-
-
Constructor Details
-
ImageTransformerConfig
public ImageTransformerConfig()
-
-
Method Details
-
setContentTypeMatcher
The matcher of content types to apply transformation on. No attempt to transform documents of any other content types will be made. Default isCommonMatchers.IMAGE_IO_CONTENT_TYPES.- Parameters:
contentTypeMatcher- content type matcher- Returns:
- this
-
getTargetFormat
-
getRotation
-
getScale
-
getCrop
-
getContentTypeMatcher
The matcher of content types to apply transformation on. No attempt to transform documents of any other content types will be made. Default isCommonMatchers.IMAGE_IO_CONTENT_TYPES.- Returns:
- content type matcher
-
setTargetFormat
- Returns:
this.
-
setRotation
- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-