Class OrientationUtil


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

      • ORIENTATION_MIRROR_HORIZONTAL

        public static final short ORIENTATION_MIRROR_HORIZONTAL
        See Also:
        Constant Field Values
      • ORIENTATION_ROTATE_180

        public static final short ORIENTATION_ROTATE_180
        See Also:
        Constant Field Values
      • ORIENTATION_MIRROR_VERTICAL

        public static final short ORIENTATION_MIRROR_VERTICAL
        See Also:
        Constant Field Values
      • ORIENTATION_MIRROR_HORIZONTAL_ROTATE_270_CW

        public static final short ORIENTATION_MIRROR_HORIZONTAL_ROTATE_270_CW
        See Also:
        Constant Field Values
      • ORIENTATION_ROTATE_90_CW

        public static final short ORIENTATION_ROTATE_90_CW
        See Also:
        Constant Field Values
      • ORIENTATION_MIRROR_HORIZONTAL_ROTATE_90_CW

        public static final short ORIENTATION_MIRROR_HORIZONTAL_ROTATE_90_CW
        See Also:
        Constant Field Values
      • ORIENTATION_ROTATE_270_CW

        public static final short ORIENTATION_ROTATE_270_CW
        See Also:
        Constant Field Values
    • Constructor Detail

      • OrientationUtil

        public OrientationUtil()
    • Method Detail

      • 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