Package com.day.cq.dam.commons.util
Class OrientationUtil
java.lang.Object
com.day.cq.dam.commons.util.OrientationUtil
The
OrientationUtil helps in adjusting a Layer
to the orientation stored in the image's EXIF or TIFF metadata.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final shortstatic final short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadjustOrientation(Asset asset, Layer layer) Adjust the given layer to the orientation stored in the asset's metadata.static shortgetOrientation(Asset asset) Get the exif orientation flag from the asset metadata.static booleanhasOrientationMetadata(Asset asset) Check if asset contains metadata for orientation.
-
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
Check if asset contains metadata for orientation.- Parameters:
asset- The asset- Returns:
trueif orientation metadata exists
-
getOrientation
Get the exif orientation flag from the asset metadata.- Parameters:
asset- the asset- Returns:
- the EXIF orientation flag (1-8)
-
adjustOrientation
Adjust the given layer to the orientation stored in the asset's metadata.- Parameters:
asset- The assetlayer- The layer
-