Class CheckImageSizeProcessor
java.lang.Object
org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
org.craftercms.studio.impl.v1.content.pipeline.CheckImageSizeProcessor
- All Implemented Interfaces:
ContentProcessor
-
Field Summary
FieldsFields inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
_matchPaths, _unmatchPaths
Fields inherited from class org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
_name
-
Constructor Summary
ConstructorsConstructorDescriptiondefault constructorconstructor that sets the process name -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
checkForImageSize
(InputStream in, int allowedWidth, int allowedHeight, boolean lessSize, ContentAssetInfoTO assetInfo) check the width and the height of the given image as an inputstream match the width and the height specifiedvoid
process
(PipelineContent content, ResultTO result) process the content at the given path.protected void
validateImageSize
(int allowedWidth, int allowedHeight, int height, int width, boolean lessSize) validate the image width and height against the allowed width and heightMethods inherited from class org.craftercms.studio.impl.v1.content.pipeline.PathMatchProcessor
isProcessable, setMatchPaths, setUnmatchPaths
Methods inherited from class org.craftercms.studio.impl.v1.content.pipeline.BaseContentProcessor
checkForMandatoryParam, getName, setName
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
CheckImageSizeProcessor
public CheckImageSizeProcessor()default constructor -
CheckImageSizeProcessor
constructor that sets the process name- Parameters:
name
-
-
-
Method Details
-
process
Description copied from interface:ContentProcessor
process the content at the given path.- Specified by:
process
in interfaceContentProcessor
- Overrides:
process
in classBaseContentProcessor
- Parameters:
content
- content to processresult
- result to return- Throws:
ContentProcessException
-
checkForImageSize
protected InputStream checkForImageSize(InputStream in, int allowedWidth, int allowedHeight, boolean lessSize, ContentAssetInfoTO assetInfo) throws ContentProcessException check the width and the height of the given image as an inputstream match the width and the height specified- Parameters:
in
-allowedWidth
-allowedHeight
-lessSize
-assetInfo
-- Returns:
- image as input stream
- Throws:
ContentProcessException
-
validateImageSize
protected void validateImageSize(int allowedWidth, int allowedHeight, int height, int width, boolean lessSize) throws ContentNotAllowedException validate the image width and height against the allowed width and height- Parameters:
allowedWidth
-allowedHeight
-height
-width
-lessSize
-- Throws:
ContentNotAllowedException
-