@Test @SmallTest public void testSetAltitude() throws IOException { for (int i = 0; i < TEST_ALTITUDE_VALUES.length; i++) { ExifInterface exif = createTestExifInterface(); exif.setAltitude(TEST_ALTITUDE_VALUES[i]); assertEquals(TEST_ALTITUDE_VALUES[i], exif.getAltitude(Double.NaN), RATIONAL_DELTA); } }
public void setAltitude(double altitude) { String ref = altitude >= 0 ? "0" : "1"; setAttribute(TAG_GPS_ALTITUDE, new Rational(Math.abs(altitude)).toString()); setAttribute(TAG_GPS_ALTITUDE_REF, ref); }
ExifInterface { public void setAltitude(double altitude) { String ref = altitude >= 0 ? "0" : "1"; setAttribute(TAG_GPS_ALTITUDE, new Rational(Math.abs(altitude)).toString()); setAttribute(TAG_GPS_ALTITUDE_REF, ref); } }
ExifInterface { public void setAltitude(double altitude) { String ref = altitude >= 0 ? "0" : "1"; setAttribute(TAG_GPS_ALTITUDE, new Rational(Math.abs(altitude)).toString()); setAttribute(TAG_GPS_ALTITUDE_REF, ref); } ExifInterface(@NonNull String filename);  ExifInterface(@NonNull InputStream inputStream); }
ExifInterface { public void setAltitude(double altitude) { String ref = altitude >= 0 ? "0" : "1"; setAttribute(TAG_GPS_ALTITUDE, new Rational(Math.abs(altitude)).toString()); setAttribute(TAG_GPS_ALTITUDE_REF, ref); } ExifInterface(@NonNull String filename);  ExifInterface(@NonNull InputStream inputStream); @Nullable String getAttribute(@NonNull String tag); int getAttributeInt(@NonNull String tag, int defaultValue); double getAttributeDouble(@NonNull String tag, double defaultValue); void setAttribute(@NonNull String tag, @Nullable String value); void resetOrientation(); void rotate(int degree); void flipVertically(); void flipHorizontally(); boolean isFlipped(); int getRotationDegrees(); void saveAttributes(); boolean hasThumbnail(); @Nullable byte[] getThumbnail(); @Nullable byte[] getThumbnailBytes(); @Nullable Bitmap getThumbnailBitmap(); boolean isThumbnailCompressed(); @Nullable long[] getThumbnailRange(); @Deprecated boolean getLatLong(float output[]); @Nullable double[] getLatLong(); void setGpsInfo(Location location); void setLatLong(double latitude, double longitude); double getAltitude(double defaultValue); void setAltitude(double altitude); @RestrictTo(RestrictTo.Scope.LIBRARY) void setDateTime(long timeStamp); @RestrictTo(RestrictTo.Scope.LIBRARY) long getDateTime(); @RestrictTo(RestrictTo.Scope.LIBRARY) long getGpsDateTime(); }
ExifInterface { public void setAltitude(double altitude) { String ref = altitude >= 0 ? "0" : "1"; setAttribute(TAG_GPS_ALTITUDE, new Rational(Math.abs(altitude)).toString()); setAttribute(TAG_GPS_ALTITUDE_REF, ref); } ExifInterface(@NonNull String filename);  ExifInterface(@NonNull InputStream inputStream); @Nullable String getAttribute(@NonNull String tag); int getAttributeInt(@NonNull String tag, int defaultValue); double getAttributeDouble(@NonNull String tag, double defaultValue); void setAttribute(@NonNull String tag, @Nullable String value); void resetOrientation(); void rotate(int degree); void flipVertically(); void flipHorizontally(); boolean isFlipped(); int getRotationDegrees(); void saveAttributes(); boolean hasThumbnail(); @Nullable byte[] getThumbnail(); @Nullable byte[] getThumbnailBytes(); @Nullable Bitmap getThumbnailBitmap(); boolean isThumbnailCompressed(); @Nullable long[] getThumbnailRange(); @Deprecated boolean getLatLong(float output[]); @Nullable double[] getLatLong(); void setGpsInfo(Location location); void setLatLong(double latitude, double longitude); double getAltitude(double defaultValue); void setAltitude(double altitude); @RestrictTo(RestrictTo.Scope.LIBRARY) void setDateTime(long timeStamp); @RestrictTo(RestrictTo.Scope.LIBRARY) long getDateTime(); @RestrictTo(RestrictTo.Scope.LIBRARY) long getGpsDateTime(); static final String TAG_IMAGE_WIDTH; static final String TAG_IMAGE_LENGTH; static final String TAG_BITS_PER_SAMPLE; static final String TAG_COMPRESSION; static final String TAG_PHOTOMETRIC_INTERPRETATION; static final String TAG_ORIENTATION; static final String TAG_SAMPLES_PER_PIXEL; static final String TAG_PLANAR_CONFIGURATION; static final String TAG_Y_CB_CR_SUB_SAMPLING; static final String TAG_Y_CB_CR_POSITIONING; static final String TAG_X_RESOLUTION; static final String TAG_Y_RESOLUTION; static final String TAG_RESOLUTION_UNIT; static final String TAG_STRIP_OFFSETS; static final String TAG_ROWS_PER_STRIP; static final String TAG_STRIP_BYTE_COUNTS; static final String TAG_JPEG_INTERCHANGE_FORMAT; static final String TAG_JPEG_INTERCHANGE_FORMAT_LENGTH; static final String TAG_TRANSFER_FUNCTION; static final String TAG_WHITE_POINT; static final String TAG_PRIMARY_CHROMATICITIES; static final String TAG_Y_CB_CR_COEFFICIENTS; static final String TAG_REFERENCE_BLACK_WHITE; static final String TAG_DATETIME; static final String TAG_IMAGE_DESCRIPTION; static final String TAG_MAKE; static final String TAG_MODEL; static final String TAG_SOFTWARE; static final String TAG_ARTIST; static final String TAG_COPYRIGHT; static final String TAG_EXIF_VERSION; static final String TAG_FLASHPIX_VERSION; static final String TAG_COLOR_SPACE; static final String TAG_GAMMA; static final String TAG_PIXEL_X_DIMENSION; static final String TAG_PIXEL_Y_DIMENSION; static final String TAG_COMPONENTS_CONFIGURATION; static final String TAG_COMPRESSED_BITS_PER_PIXEL; static final String TAG_MAKER_NOTE; static final String TAG_USER_COMMENT; static final String TAG_RELATED_SOUND_FILE; static final String TAG_DATETIME_ORIGINAL; static final String TAG_DATETIME_DIGITIZED; static final String TAG_SUBSEC_TIME; static final String TAG_SUBSEC_TIME_ORIGINAL; static final String TAG_SUBSEC_TIME_DIGITIZED; static final String TAG_EXPOSURE_TIME; static final String TAG_F_NUMBER; static final String TAG_EXPOSURE_PROGRAM; static final String TAG_SPECTRAL_SENSITIVITY; @Deprecated static final String TAG_ISO_SPEED_RATINGS; static final String TAG_PHOTOGRAPHIC_SENSITIVITY; static final String TAG_OECF; static final String TAG_SENSITIVITY_TYPE; static final String TAG_STANDARD_OUTPUT_SENSITIVITY; static final String TAG_RECOMMENDED_EXPOSURE_INDEX; static final String TAG_ISO_SPEED; static final String TAG_ISO_SPEED_LATITUDE_YYY; static final String TAG_ISO_SPEED_LATITUDE_ZZZ; static final String TAG_SHUTTER_SPEED_VALUE; static final String TAG_APERTURE_VALUE; static final String TAG_BRIGHTNESS_VALUE; static final String TAG_EXPOSURE_BIAS_VALUE; static final String TAG_MAX_APERTURE_VALUE; static final String TAG_SUBJECT_DISTANCE; static final String TAG_METERING_MODE; static final String TAG_LIGHT_SOURCE; static final String TAG_FLASH; static final String TAG_SUBJECT_AREA; static final String TAG_FOCAL_LENGTH; static final String TAG_FLASH_ENERGY; static final String TAG_SPATIAL_FREQUENCY_RESPONSE; static final String TAG_FOCAL_PLANE_X_RESOLUTION; static final String TAG_FOCAL_PLANE_Y_RESOLUTION; static final String TAG_FOCAL_PLANE_RESOLUTION_UNIT; static final String TAG_SUBJECT_LOCATION; static final String TAG_EXPOSURE_INDEX; static final String TAG_SENSING_METHOD; static final String TAG_FILE_SOURCE; static final String TAG_SCENE_TYPE; static final String TAG_CFA_PATTERN; static final String TAG_CUSTOM_RENDERED; static final String TAG_EXPOSURE_MODE; static final String TAG_WHITE_BALANCE; static final String TAG_DIGITAL_ZOOM_RATIO; static final String TAG_FOCAL_LENGTH_IN_35MM_FILM; static final String TAG_SCENE_CAPTURE_TYPE; static final String TAG_GAIN_CONTROL; static final String TAG_CONTRAST; static final String TAG_SATURATION; static final String TAG_SHARPNESS; static final String TAG_DEVICE_SETTING_DESCRIPTION; static final String TAG_SUBJECT_DISTANCE_RANGE; static final String TAG_IMAGE_UNIQUE_ID; static final String TAG_CAMARA_OWNER_NAME; static final String TAG_BODY_SERIAL_NUMBER; static final String TAG_LENS_SPECIFICATION; static final String TAG_LENS_MAKE; static final String TAG_LENS_MODEL; static final String TAG_LENS_SERIAL_NUMBER; static final String TAG_GPS_VERSION_ID; static final String TAG_GPS_LATITUDE_REF; static final String TAG_GPS_LATITUDE; static final String TAG_GPS_LONGITUDE_REF; static final String TAG_GPS_LONGITUDE; static final String TAG_GPS_ALTITUDE_REF; static final String TAG_GPS_ALTITUDE; static final String TAG_GPS_TIMESTAMP; static final String TAG_GPS_SATELLITES; static final String TAG_GPS_STATUS; static final String TAG_GPS_MEASURE_MODE; static final String TAG_GPS_DOP; static final String TAG_GPS_SPEED_REF; static final String TAG_GPS_SPEED; static final String TAG_GPS_TRACK_REF; static final String TAG_GPS_TRACK; static final String TAG_GPS_IMG_DIRECTION_REF; static final String TAG_GPS_IMG_DIRECTION; static final String TAG_GPS_MAP_DATUM; static final String TAG_GPS_DEST_LATITUDE_REF; static final String TAG_GPS_DEST_LATITUDE; static final String TAG_GPS_DEST_LONGITUDE_REF; static final String TAG_GPS_DEST_LONGITUDE; static final String TAG_GPS_DEST_BEARING_REF; static final String TAG_GPS_DEST_BEARING; static final String TAG_GPS_DEST_DISTANCE_REF; static final String TAG_GPS_DEST_DISTANCE; static final String TAG_GPS_PROCESSING_METHOD; static final String TAG_GPS_AREA_INFORMATION; static final String TAG_GPS_DATESTAMP; static final String TAG_GPS_DIFFERENTIAL; static final String TAG_GPS_H_POSITIONING_ERROR; static final String TAG_INTEROPERABILITY_INDEX; static final String TAG_THUMBNAIL_IMAGE_LENGTH; static final String TAG_THUMBNAIL_IMAGE_WIDTH; static final String TAG_DNG_VERSION; static final String TAG_DEFAULT_CROP_SIZE; static final String TAG_ORF_THUMBNAIL_IMAGE; static final String TAG_ORF_PREVIEW_IMAGE_START; static final String TAG_ORF_PREVIEW_IMAGE_LENGTH; static final String TAG_ORF_ASPECT_FRAME; static final String TAG_RW2_SENSOR_BOTTOM_BORDER; static final String TAG_RW2_SENSOR_LEFT_BORDER; static final String TAG_RW2_SENSOR_RIGHT_BORDER; static final String TAG_RW2_SENSOR_TOP_BORDER; static final String TAG_RW2_ISO; static final String TAG_RW2_JPG_FROM_RAW; static final String TAG_NEW_SUBFILE_TYPE; static final String TAG_SUBFILE_TYPE; static final int ORIENTATION_UNDEFINED; static final int ORIENTATION_NORMAL; static final int ORIENTATION_FLIP_HORIZONTAL; static final int ORIENTATION_ROTATE_180; static final int ORIENTATION_FLIP_VERTICAL; static final int ORIENTATION_TRANSPOSE; static final int ORIENTATION_ROTATE_90; static final int ORIENTATION_TRANSVERSE; static final int ORIENTATION_ROTATE_270; static final short FORMAT_CHUNKY; static final short FORMAT_PLANAR; static final short Y_CB_CR_POSITIONING_CENTERED; static final short Y_CB_CR_POSITIONING_CO_SITED; static final short RESOLUTION_UNIT_INCHES; static final short RESOLUTION_UNIT_CENTIMETERS; static final int COLOR_SPACE_S_RGB; static final int COLOR_SPACE_UNCALIBRATED; static final short EXPOSURE_PROGRAM_NOT_DEFINED; static final short EXPOSURE_PROGRAM_MANUAL; static final short EXPOSURE_PROGRAM_NORMAL; static final short EXPOSURE_PROGRAM_APERTURE_PRIORITY; static final short EXPOSURE_PROGRAM_SHUTTER_PRIORITY; static final short EXPOSURE_PROGRAM_CREATIVE; static final short EXPOSURE_PROGRAM_ACTION; static final short EXPOSURE_PROGRAM_PORTRAIT_MODE; static final short EXPOSURE_PROGRAM_LANDSCAPE_MODE; static final short SENSITIVITY_TYPE_UNKNOWN; static final short SENSITIVITY_TYPE_SOS; static final short SENSITIVITY_TYPE_REI; static final short SENSITIVITY_TYPE_ISO_SPEED; static final short SENSITIVITY_TYPE_SOS_AND_REI; static final short SENSITIVITY_TYPE_SOS_AND_ISO; static final short SENSITIVITY_TYPE_REI_AND_ISO; static final short SENSITIVITY_TYPE_SOS_AND_REI_AND_ISO; static final short METERING_MODE_UNKNOWN; static final short METERING_MODE_AVERAGE; static final short METERING_MODE_CENTER_WEIGHT_AVERAGE; static final short METERING_MODE_SPOT; static final short METERING_MODE_MULTI_SPOT; static final short METERING_MODE_PATTERN; static final short METERING_MODE_PARTIAL; static final short METERING_MODE_OTHER; static final short LIGHT_SOURCE_UNKNOWN; static final short LIGHT_SOURCE_DAYLIGHT; static final short LIGHT_SOURCE_FLUORESCENT; static final short LIGHT_SOURCE_TUNGSTEN; static final short LIGHT_SOURCE_FLASH; static final short LIGHT_SOURCE_FINE_WEATHER; static final short LIGHT_SOURCE_CLOUDY_WEATHER; static final short LIGHT_SOURCE_SHADE; static final short LIGHT_SOURCE_DAYLIGHT_FLUORESCENT; static final short LIGHT_SOURCE_DAY_WHITE_FLUORESCENT; static final short LIGHT_SOURCE_COOL_WHITE_FLUORESCENT; static final short LIGHT_SOURCE_WHITE_FLUORESCENT; static final short LIGHT_SOURCE_WARM_WHITE_FLUORESCENT; static final short LIGHT_SOURCE_STANDARD_LIGHT_A; static final short LIGHT_SOURCE_STANDARD_LIGHT_B; static final short LIGHT_SOURCE_STANDARD_LIGHT_C; static final short LIGHT_SOURCE_D55; static final short LIGHT_SOURCE_D65; static final short LIGHT_SOURCE_D75; static final short LIGHT_SOURCE_D50; static final short LIGHT_SOURCE_ISO_STUDIO_TUNGSTEN; static final short LIGHT_SOURCE_OTHER; static final short FLAG_FLASH_FIRED; static final short FLAG_FLASH_RETURN_LIGHT_NOT_DETECTED; static final short FLAG_FLASH_RETURN_LIGHT_DETECTED; static final short FLAG_FLASH_MODE_COMPULSORY_FIRING; static final short FLAG_FLASH_MODE_COMPULSORY_SUPPRESSION; static final short FLAG_FLASH_MODE_AUTO; static final short FLAG_FLASH_NO_FLASH_FUNCTION; static final short FLAG_FLASH_RED_EYE_SUPPORTED; static final short SENSOR_TYPE_NOT_DEFINED; static final short SENSOR_TYPE_ONE_CHIP; static final short SENSOR_TYPE_TWO_CHIP; static final short SENSOR_TYPE_THREE_CHIP; static final short SENSOR_TYPE_COLOR_SEQUENTIAL; static final short SENSOR_TYPE_TRILINEAR; static final short SENSOR_TYPE_COLOR_SEQUENTIAL_LINEAR; static final short FILE_SOURCE_OTHER; static final short FILE_SOURCE_TRANSPARENT_SCANNER; static final short FILE_SOURCE_REFLEX_SCANNER; static final short FILE_SOURCE_DSC; static final short SCENE_TYPE_DIRECTLY_PHOTOGRAPHED; static final short RENDERED_PROCESS_NORMAL; static final short RENDERED_PROCESS_CUSTOM; static final short EXPOSURE_MODE_AUTO; static final short EXPOSURE_MODE_MANUAL; static final short EXPOSURE_MODE_AUTO_BRACKET; @Deprecated static final int WHITEBALANCE_AUTO; @Deprecated static final int WHITEBALANCE_MANUAL; static final short WHITE_BALANCE_AUTO; static final short WHITE_BALANCE_MANUAL; static final short SCENE_CAPTURE_TYPE_STANDARD; static final short SCENE_CAPTURE_TYPE_LANDSCAPE; static final short SCENE_CAPTURE_TYPE_PORTRAIT; static final short SCENE_CAPTURE_TYPE_NIGHT; static final short GAIN_CONTROL_NONE; static final short GAIN_CONTROL_LOW_GAIN_UP; static final short GAIN_CONTROL_HIGH_GAIN_UP; static final short GAIN_CONTROL_LOW_GAIN_DOWN; static final short GAIN_CONTROL_HIGH_GAIN_DOWN; static final short CONTRAST_NORMAL; static final short CONTRAST_SOFT; static final short CONTRAST_HARD; static final short SATURATION_NORMAL; static final short SATURATION_LOW; static final short SATURATION_HIGH; static final short SHARPNESS_NORMAL; static final short SHARPNESS_SOFT; static final short SHARPNESS_HARD; static final short SUBJECT_DISTANCE_RANGE_UNKNOWN; static final short SUBJECT_DISTANCE_RANGE_MACRO; static final short SUBJECT_DISTANCE_RANGE_CLOSE_VIEW; static final short SUBJECT_DISTANCE_RANGE_DISTANT_VIEW; static final String LATITUDE_NORTH; static final String LATITUDE_SOUTH; static final String LONGITUDE_EAST; static final String LONGITUDE_WEST; static final short ALTITUDE_ABOVE_SEA_LEVEL; static final short ALTITUDE_BELOW_SEA_LEVEL; static final String GPS_MEASUREMENT_IN_PROGRESS; static final String GPS_MEASUREMENT_INTERRUPTED; static final String GPS_MEASUREMENT_2D; static final String GPS_MEASUREMENT_3D; static final String GPS_SPEED_KILOMETERS_PER_HOUR; static final String GPS_SPEED_MILES_PER_HOUR; static final String GPS_SPEED_KNOTS; static final String GPS_DIRECTION_TRUE; static final String GPS_DIRECTION_MAGNETIC; static final String GPS_DISTANCE_KILOMETERS; static final String GPS_DISTANCE_MILES; static final String GPS_DISTANCE_NAUTICAL_MILES; static final short GPS_MEASUREMENT_NO_DIFFERENTIAL; static final short GPS_MEASUREMENT_DIFFERENTIAL_CORRECTED; static final int DATA_UNCOMPRESSED; static final int DATA_HUFFMAN_COMPRESSED; static final int DATA_JPEG; static final int DATA_JPEG_COMPRESSED; static final int DATA_DEFLATE_ZIP; static final int DATA_PACK_BITS_COMPRESSED; static final int DATA_LOSSY_JPEG; static final int[] BITS_PER_SAMPLE_RGB; static final int[] BITS_PER_SAMPLE_GREYSCALE_1; static final int[] BITS_PER_SAMPLE_GREYSCALE_2; static final int PHOTOMETRIC_INTERPRETATION_WHITE_IS_ZERO; static final int PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO; static final int PHOTOMETRIC_INTERPRETATION_RGB; static final int PHOTOMETRIC_INTERPRETATION_YCBCR; static final int ORIGINAL_RESOLUTION_IMAGE; static final int REDUCED_RESOLUTION_IMAGE; }