Class CmsResourceTypeImage.CmsImageAdjuster

java.lang.Object
org.opencms.file.types.CmsResourceTypeImage.CmsImageAdjuster
Enclosing class:
CmsResourceTypeImage

protected static class CmsResourceTypeImage.CmsImageAdjuster extends Object
A data container for image size and scale operations.

  • Field Details

    • DEFAULT_ORIENTATION

      public static final int 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 content
      rootPath - the image root path
      properties - the image properties
      downScaler - the (optional) image scaler that contains the image downscale settings
  • Method Details

    • adjust

      public void 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 CmsPropertyDefinition.PROPERTY_IMAGE_SIZE that contains the calculated image dimensions.

    • getContent

      public byte[] getContent()
      Returns the image content.

      Returns:
      the image content
    • getProperties

      Returns the image properties.

      Returns:
      the image properties
    • getRootPath

      public String getRootPath()
      Returns the image VFS root path.

      Returns:
      the image VFS root path