1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.images
;
6 * {@code InputSettings} represents the different settings to specify how
7 * an {@link Image} is interpreted by a transform.
10 public class InputSettings
{
12 * Actions to take with respect to correcting image orientation based
13 * on image metadata. EXIF metadata within the image may contain a parameter
14 * indicating its proper orientation. This value can equal 1 through 8,
15 * inclusive. "1" means that the image is in its "normal" orientation, i.e.,
16 * it should be viewed as it is stored.
18 * <p>Regardless of the {@code OrientationCorrection} value used, the
19 * orientation value in a transformed image is always cleared to indicate that
20 * no additional corrections of the returned image's orientation is necessary.
22 public static enum OrientationCorrection
{
24 * Do not apply any orientation correction specified in the EXIF metadata.
26 UNCHANGED_ORIENTATION
,
28 * Apply any orientation specified in the EXIF metadata to the image during
29 * the first transformation.
31 * <p>NOTE: If the image is already in portrait orientation, i.e., "taller"
32 * than it is "wide" no correction will be made, since it appears that the
33 * camera has already corrected it.
39 * What action should be taken with respect to correcting orientation.
41 private OrientationCorrection orientationCorrection
;
44 * Create an InputSettings with default orientation correction of
45 * {@link OrientationCorrection#UNCHANGED_ORIENTATION}.
47 public InputSettings() {
48 orientationCorrection
= OrientationCorrection
.UNCHANGED_ORIENTATION
;
52 * Set what action to take with respect to correcting image orientation based
54 * @param orientationCorrection what should be done to correct orientation
56 public void setOrientationCorrection(OrientationCorrection orientationCorrection
) {
57 this.orientationCorrection
= orientationCorrection
;
61 * Get what action to take with respect to correcting image orientation based
63 * @return what should be done to correct orientation
65 public OrientationCorrection
getOrientationCorrection() {
66 return orientationCorrection
;