Class OrientationUtil

java.lang.Object
com.day.cq.dam.commons.util.OrientationUtil

public class OrientationUtil extends Object
The OrientationUtil helps in adjusting a Layer to the orientation stored in the image's EXIF or TIFF metadata.
  • Field Details

    • ORIENTATION_NORMAL

      public static final short ORIENTATION_NORMAL
      See Also:
    • ORIENTATION_MIRROR_HORIZONTAL

      public static final short ORIENTATION_MIRROR_HORIZONTAL
      See Also:
    • ORIENTATION_ROTATE_180

      public static final short ORIENTATION_ROTATE_180
      See Also:
    • ORIENTATION_MIRROR_VERTICAL

      public static final short ORIENTATION_MIRROR_VERTICAL
      See Also:
    • ORIENTATION_MIRROR_HORIZONTAL_ROTATE_270_CW

      public static final short ORIENTATION_MIRROR_HORIZONTAL_ROTATE_270_CW
      See Also:
    • ORIENTATION_ROTATE_90_CW

      public static final short ORIENTATION_ROTATE_90_CW
      See Also:
    • ORIENTATION_MIRROR_HORIZONTAL_ROTATE_90_CW

      public static final short ORIENTATION_MIRROR_HORIZONTAL_ROTATE_90_CW
      See Also:
    • ORIENTATION_ROTATE_270_CW

      public static final short ORIENTATION_ROTATE_270_CW
      See Also:
  • Constructor Details

    • OrientationUtil

      public OrientationUtil()
  • Method Details

    • hasOrientationMetadata

      public static boolean hasOrientationMetadata(Asset asset)
      Check if asset contains metadata for orientation.
      Parameters:
      asset - The asset
      Returns:
      true if orientation metadata exists
    • getOrientation

      public static short getOrientation(Asset asset)
      Get the exif orientation flag from the asset metadata.
      Parameters:
      asset - the asset
      Returns:
      the EXIF orientation flag (1-8)
    • adjustOrientation

      public static void adjustOrientation(Asset asset, Layer layer)
      Adjust the given layer to the orientation stored in the asset's metadata.
      Parameters:
      asset - The asset
      layer - The layer