Package org.opencms.file.types
Class CmsResourceTypeImage.CmsImageAdjuster
java.lang.Object
org.opencms.file.types.CmsResourceTypeImage.CmsImageAdjuster
- Enclosing class:
- CmsResourceTypeImage
A data container for image size and scale operations.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Value for EXIF Orientation tag that says that the image is oriented as-is (requires no rotation/mirroring). -
Constructor Summary
ConstructorDescriptionCmsImageAdjuster
(byte[] content, String rootPath, List<CmsProperty> properties, CmsImageScaler downScaler) Creates a new image data container. -
Method Summary
Modifier and TypeMethodDescriptionvoid
adjust()
Calculates the image size and adjusts the image dimensions (if required) accoring to the configured image downscale settings.byte[]
Returns the image content.Returns the image properties.Returns the image VFS root path.
-
Field Details
-
DEFAULT_ORIENTATION
Value for EXIF Orientation tag that says that the image is oriented as-is (requires no rotation/mirroring).- See Also:
-
-
Constructor Details
-
CmsImageAdjuster
public CmsImageAdjuster(byte[] content, String rootPath, List<CmsProperty> properties, CmsImageScaler downScaler) Creates a new image data container.- Parameters:
content
- the image byte contentrootPath
- the image root pathproperties
- the image propertiesdownScaler
- the (optional) image scaler that contains the image downscale settings
-
-
Method Details
-
adjust
Calculates the image size and adjusts the image dimensions (if required) accoring to the configured image downscale settings.The image dimensions are always calculated from the given image. The internal list of properties is updated with a value for
that contains the calculated image dimensions.CmsPropertyDefinition.PROPERTY_IMAGE_SIZE
-
getContent
Returns the image content.- Returns:
- the image content
-
getProperties
Returns the image properties.- Returns:
- the image properties
-
getRootPath
Returns the image VFS root path.- Returns:
- the image VFS root path
-