Package com.day.cq.dam.commons.util
Class OrientationUtil
- java.lang.Object
-
- com.day.cq.dam.commons.util.OrientationUtil
-
public class OrientationUtil extends java.lang.Object
TheOrientationUtil
helps in adjusting aLayer
to the orientation stored in the image's EXIF or TIFF metadata.
-
-
Field Summary
Fields Modifier and Type Field Description static short
ORIENTATION_MIRROR_HORIZONTAL
static short
ORIENTATION_MIRROR_HORIZONTAL_ROTATE_270_CW
static short
ORIENTATION_MIRROR_HORIZONTAL_ROTATE_90_CW
static short
ORIENTATION_MIRROR_VERTICAL
static short
ORIENTATION_NORMAL
static short
ORIENTATION_ROTATE_180
static short
ORIENTATION_ROTATE_270_CW
static short
ORIENTATION_ROTATE_90_CW
-
Constructor Summary
Constructors Constructor Description OrientationUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
adjustOrientation(Asset asset, Layer layer)
Adjust the given layer to the orientation stored in the asset's metadata.static short
getOrientation(Asset asset)
Get the exif orientation flag from the asset metadata.static boolean
hasOrientationMetadata(Asset asset)
Check if asset contains metadata for orientation.
-
-
-
Field Detail
-
ORIENTATION_NORMAL
public static final short ORIENTATION_NORMAL
- See Also:
- Constant Field Values
-
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
-
-
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)
-
-