首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android:图像上传到web服务会丢失EXIF数据。

Android:图像上传到web服务会丢失EXIF数据。
EN

Stack Overflow用户
提问于 2013-08-16 15:03:37
回答 4查看 2.4K关注 0票数 3

请帮帮忙,

目前,我上传了一个图片到我的网站服务,它确实有EXIF数据附加在上传时它。当它到达服务器时,它是减去它的exif数据。

代码语言:javascript
运行
复制
  Bitmap bmp = BitmapFactory.decodeFile(fullFileName);
                  if (bmp == null) {
                    //oh sugar, not cool
                     continue;
                }
                  ByteArrayOutputStream stream = new ByteArrayOutputStream();
                  bmp.compress(Bitmap.CompressFormat.JPEG, 60, stream);
                  byte[] byteArray = stream.toByteArray();


                DefaultHttpClient client = new DefaultHttpClient();
                HttpPost post = new HttpPost("webserviceurl");
                ByteArrayEntity test = new ByteArrayEntity(byteArray){...}

     post.setEntity(test);   

在上传图像之前,将其存储到设备SD卡中,然后使用BitmapFactory类对其进行解码。

我在想,在图像压缩过程中,它丢失了,有人找到了解决方案或想法吗?

谢谢

Burrows111

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2013-08-22 12:43:38

EXIF数据在编码期间被剥离。但是,ExifInterface将允许您在压缩文件上设置EXIF数据。不幸的是,您需要压缩图像,将其写入文件,然后在文件上设置EXIF,最后将其上传。

票数 4
EN

Stack Overflow用户

发布于 2015-08-20 18:52:07

我这样做是为了让其他人不用经历单调的生活.

代码语言:javascript
运行
复制
public static void copyExifData(String file1, String file2){
        try {
            ExifInterface file1Exif = new ExifInterface(file1);
            ExifInterface file2Exif = new ExifInterface(file2);

            String aperture = file1Exif.getAttribute(ExifInterface.TAG_APERTURE);
            String dateTime = file1Exif.getAttribute(ExifInterface.TAG_DATETIME);
            String exposureTime = file1Exif.getAttribute(ExifInterface.TAG_EXPOSURE_TIME);
            String flash = file1Exif.getAttribute(ExifInterface.TAG_FLASH);
            String focalLength = file1Exif.getAttribute(ExifInterface.TAG_FOCAL_LENGTH);
            String gpsAltitude = file1Exif.getAttribute(ExifInterface.TAG_GPS_ALTITUDE);
            String gpsAltitudeRef = file1Exif.getAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF);
            String gpsDateStamp = file1Exif.getAttribute(ExifInterface.TAG_GPS_DATESTAMP);
            String gpsLatitude = file1Exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
            String gpsLatitudeRef = file1Exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF);
            String gpsLongitude = file1Exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
            String gpsLongitudeRef = file1Exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF);
            String gpsProcessingMethod = file1Exif.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD);
            String gpsTimestamp = file1Exif.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP);
            Integer imageLength = file1Exif.getAttributeInt(ExifInterface.TAG_IMAGE_LENGTH, 0);
            Integer imageWidth = file1Exif.getAttributeInt(ExifInterface.TAG_IMAGE_WIDTH, 0);
            String iso = file1Exif.getAttribute(ExifInterface.TAG_ISO);
            String make = file1Exif.getAttribute(ExifInterface.TAG_MAKE);
            String model = file1Exif.getAttribute(ExifInterface.TAG_MODEL);
            Integer orientation = file1Exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
            Integer whiteBalance = file1Exif.getAttributeInt(ExifInterface.TAG_WHITE_BALANCE, 0);


            file2Exif.setAttribute(ExifInterface.TAG_ORIENTATION, orientation.toString());
            file2Exif.setAttribute(ExifInterface.TAG_APERTURE, aperture);
            file2Exif.setAttribute(ExifInterface.TAG_DATETIME, dateTime);
            file2Exif.setAttribute(ExifInterface.TAG_EXPOSURE_TIME, exposureTime);
            file2Exif.setAttribute(ExifInterface.TAG_FLASH, flash);
            file2Exif.setAttribute(ExifInterface.TAG_FOCAL_LENGTH, focalLength);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, gpsAltitude);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF, gpsAltitudeRef);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_DATESTAMP, gpsDateStamp);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, gpsLatitude);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, gpsLatitudeRef);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, gpsLongitude);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, gpsLongitudeRef);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD, gpsProcessingMethod);
            file2Exif.setAttribute(ExifInterface.TAG_GPS_TIMESTAMP, gpsTimestamp);
            file2Exif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, imageLength.toString());
            file2Exif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, imageWidth.toString());
            file2Exif.setAttribute(ExifInterface.TAG_ISO, iso);
            file2Exif.setAttribute(ExifInterface.TAG_MAKE, make);
            file2Exif.setAttribute(ExifInterface.TAG_MODEL, model);
            file2Exif.setAttribute(ExifInterface.TAG_WHITE_BALANCE, whiteBalance.toString());
            file2Exif.saveAttributes();
        }
        catch (FileNotFoundException io) {}
        catch (IOException io) {}
        catch (NullPointerException np){}
    }
票数 1
EN

Stack Overflow用户

发布于 2020-03-31 14:07:45

我知道这个问题很老,但我不得不用Kotlin编写一种方法来复制exif数据,我认为这可能会对其他人有所帮助。

代码语言:javascript
运行
复制
import androidx.exifinterface.media.ExifInterface

class ExifUtils {

    companion object {

        fun copyExif(src: ExifInterface, dest: ExifInterface) {

            dest.setAttribute(ExifInterface.TAG_APERTURE_VALUE, src.getAttribute(ExifInterface.TAG_APERTURE_VALUE))
            dest.setAttribute(ExifInterface.TAG_ARTIST, src.getAttribute(ExifInterface.TAG_ARTIST))
            dest.setAttribute(ExifInterface.TAG_BITS_PER_SAMPLE, src.getAttribute(ExifInterface.TAG_BITS_PER_SAMPLE))
            dest.setAttribute(ExifInterface.TAG_BODY_SERIAL_NUMBER, src.getAttribute(ExifInterface.TAG_BODY_SERIAL_NUMBER))
            dest.setAttribute(ExifInterface.TAG_BRIGHTNESS_VALUE, src.getAttribute(ExifInterface.TAG_BRIGHTNESS_VALUE))
            dest.setAttribute(ExifInterface.TAG_CAMERA_OWNER_NAME, src.getAttribute(ExifInterface.TAG_CAMERA_OWNER_NAME))
            dest.setAttribute(ExifInterface.TAG_CFA_PATTERN, src.getAttribute(ExifInterface.TAG_CFA_PATTERN))
            dest.setAttribute(ExifInterface.TAG_COLOR_SPACE, src.getAttribute(ExifInterface.TAG_COLOR_SPACE))
            dest.setAttribute(ExifInterface.TAG_COMPONENTS_CONFIGURATION, src.getAttribute(ExifInterface.TAG_COMPONENTS_CONFIGURATION))
            dest.setAttribute(ExifInterface.TAG_COMPRESSED_BITS_PER_PIXEL, src.getAttribute(ExifInterface.TAG_COMPRESSED_BITS_PER_PIXEL))
            dest.setAttribute(ExifInterface.TAG_COMPRESSION, src.getAttribute(ExifInterface.TAG_COMPRESSION))
            dest.setAttribute(ExifInterface.TAG_CONTRAST, src.getAttribute(ExifInterface.TAG_CONTRAST))
            dest.setAttribute(ExifInterface.TAG_COPYRIGHT, src.getAttribute(ExifInterface.TAG_COPYRIGHT))
            dest.setAttribute(ExifInterface.TAG_CUSTOM_RENDERED, src.getAttribute(ExifInterface.TAG_CUSTOM_RENDERED))
            dest.setAttribute(ExifInterface.TAG_DATETIME, src.getAttribute(ExifInterface.TAG_DATETIME))
            dest.setAttribute(ExifInterface.TAG_DATETIME_DIGITIZED, src.getAttribute(ExifInterface.TAG_DATETIME_DIGITIZED))
            dest.setAttribute(ExifInterface.TAG_DATETIME_ORIGINAL, src.getAttribute(ExifInterface.TAG_DATETIME_ORIGINAL))
            dest.setAttribute(ExifInterface.TAG_DEFAULT_CROP_SIZE, src.getAttribute(ExifInterface.TAG_DEFAULT_CROP_SIZE))
            dest.setAttribute(ExifInterface.TAG_DEVICE_SETTING_DESCRIPTION, src.getAttribute(ExifInterface.TAG_DEVICE_SETTING_DESCRIPTION))
            dest.setAttribute(ExifInterface.TAG_DIGITAL_ZOOM_RATIO, src.getAttribute(ExifInterface.TAG_DIGITAL_ZOOM_RATIO))
            dest.setAttribute(ExifInterface.TAG_DNG_VERSION, src.getAttribute(ExifInterface.TAG_DNG_VERSION))
            dest.setAttribute(ExifInterface.TAG_EXIF_VERSION, src.getAttribute(ExifInterface.TAG_EXIF_VERSION))
            dest.setAttribute(ExifInterface.TAG_EXPOSURE_BIAS_VALUE, src.getAttribute(ExifInterface.TAG_EXPOSURE_BIAS_VALUE))
            dest.setAttribute(ExifInterface.TAG_EXPOSURE_INDEX, src.getAttribute(ExifInterface.TAG_EXPOSURE_INDEX))
            dest.setAttribute(ExifInterface.TAG_EXPOSURE_MODE, src.getAttribute(ExifInterface.TAG_EXPOSURE_MODE))
            dest.setAttribute(ExifInterface.TAG_EXPOSURE_PROGRAM, src.getAttribute(ExifInterface.TAG_EXPOSURE_PROGRAM))
            dest.setAttribute(ExifInterface.TAG_EXPOSURE_TIME, src.getAttribute(ExifInterface.TAG_EXPOSURE_TIME))
            dest.setAttribute(ExifInterface.TAG_FILE_SOURCE, src.getAttribute(ExifInterface.TAG_FILE_SOURCE))
            dest.setAttribute(ExifInterface.TAG_FLASH, src.getAttribute(ExifInterface.TAG_FLASH))
            dest.setAttribute(ExifInterface.TAG_FLASHPIX_VERSION, src.getAttribute(ExifInterface.TAG_FLASHPIX_VERSION))
            dest.setAttribute(ExifInterface.TAG_FLASH_ENERGY, src.getAttribute(ExifInterface.TAG_FLASH_ENERGY))
            dest.setAttribute(ExifInterface.TAG_FOCAL_LENGTH, src.getAttribute(ExifInterface.TAG_FOCAL_LENGTH))
            dest.setAttribute(ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM, src.getAttribute(ExifInterface.TAG_FOCAL_LENGTH_IN_35MM_FILM))
            dest.setAttribute(ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT, src.getAttribute(ExifInterface.TAG_FOCAL_PLANE_RESOLUTION_UNIT))
            dest.setAttribute(ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION, src.getAttribute(ExifInterface.TAG_FOCAL_PLANE_X_RESOLUTION))
            dest.setAttribute(ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION, src.getAttribute(ExifInterface.TAG_FOCAL_PLANE_Y_RESOLUTION))
            dest.setAttribute(ExifInterface.TAG_F_NUMBER, src.getAttribute(ExifInterface.TAG_F_NUMBER))
            dest.setAttribute(ExifInterface.TAG_GAIN_CONTROL, src.getAttribute(ExifInterface.TAG_GAIN_CONTROL))
            dest.setAttribute(ExifInterface.TAG_GAMMA, src.getAttribute(ExifInterface.TAG_GAMMA))
            dest.setAttribute(ExifInterface.TAG_GPS_ALTITUDE, src.getAttribute(ExifInterface.TAG_GPS_ALTITUDE))
            dest.setAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF, src.getAttribute(ExifInterface.TAG_GPS_ALTITUDE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_AREA_INFORMATION, src.getAttribute(ExifInterface.TAG_GPS_AREA_INFORMATION))
            dest.setAttribute(ExifInterface.TAG_GPS_DATESTAMP, src.getAttribute(ExifInterface.TAG_GPS_DATESTAMP))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_BEARING, src.getAttribute(ExifInterface.TAG_GPS_DEST_BEARING))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_BEARING_REF, src.getAttribute(ExifInterface.TAG_GPS_DEST_BEARING_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_DISTANCE, src.getAttribute(ExifInterface.TAG_GPS_DEST_DISTANCE))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_DISTANCE_REF, src.getAttribute(ExifInterface.TAG_GPS_DEST_DISTANCE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_LATITUDE, src.getAttribute(ExifInterface.TAG_GPS_DEST_LATITUDE))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_LATITUDE_REF, src.getAttribute(ExifInterface.TAG_GPS_DEST_LATITUDE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_LONGITUDE, src.getAttribute(ExifInterface.TAG_GPS_DEST_LONGITUDE))
            dest.setAttribute(ExifInterface.TAG_GPS_DEST_LONGITUDE_REF, src.getAttribute(ExifInterface.TAG_GPS_DEST_LONGITUDE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_DIFFERENTIAL, src.getAttribute(ExifInterface.TAG_GPS_DIFFERENTIAL))
            dest.setAttribute(ExifInterface.TAG_GPS_DOP, src.getAttribute(ExifInterface.TAG_GPS_DOP))
            dest.setAttribute(ExifInterface.TAG_GPS_H_POSITIONING_ERROR, src.getAttribute(ExifInterface.TAG_GPS_H_POSITIONING_ERROR))
            dest.setAttribute(ExifInterface.TAG_GPS_IMG_DIRECTION, src.getAttribute(ExifInterface.TAG_GPS_IMG_DIRECTION))
            dest.setAttribute(ExifInterface.TAG_GPS_IMG_DIRECTION_REF, src.getAttribute(ExifInterface.TAG_GPS_IMG_DIRECTION_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_LATITUDE, src.getAttribute(ExifInterface.TAG_GPS_LATITUDE))
            dest.setAttribute(ExifInterface.TAG_GPS_LATITUDE_REF, src.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_LONGITUDE, src.getAttribute(ExifInterface.TAG_GPS_LONGITUDE))
            dest.setAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF, src.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_MAP_DATUM, src.getAttribute(ExifInterface.TAG_GPS_MAP_DATUM))
            dest.setAttribute(ExifInterface.TAG_GPS_MEASURE_MODE, src.getAttribute(ExifInterface.TAG_GPS_MEASURE_MODE))
            dest.setAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD, src.getAttribute(ExifInterface.TAG_GPS_PROCESSING_METHOD))
            dest.setAttribute(ExifInterface.TAG_GPS_SATELLITES, src.getAttribute(ExifInterface.TAG_GPS_SATELLITES))
            dest.setAttribute(ExifInterface.TAG_GPS_SPEED, src.getAttribute(ExifInterface.TAG_GPS_SPEED))
            dest.setAttribute(ExifInterface.TAG_GPS_SPEED_REF, src.getAttribute(ExifInterface.TAG_GPS_SPEED_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_STATUS, src.getAttribute(ExifInterface.TAG_GPS_STATUS))
            dest.setAttribute(ExifInterface.TAG_GPS_TIMESTAMP, src.getAttribute(ExifInterface.TAG_GPS_TIMESTAMP))
            dest.setAttribute(ExifInterface.TAG_GPS_TRACK, src.getAttribute(ExifInterface.TAG_GPS_TRACK))
            dest.setAttribute(ExifInterface.TAG_GPS_TRACK_REF, src.getAttribute(ExifInterface.TAG_GPS_TRACK_REF))
            dest.setAttribute(ExifInterface.TAG_GPS_VERSION_ID, src.getAttribute(ExifInterface.TAG_GPS_VERSION_ID))
            dest.setAttribute(ExifInterface.TAG_IMAGE_DESCRIPTION, src.getAttribute(ExifInterface.TAG_IMAGE_DESCRIPTION))
            dest.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, src.getAttribute(ExifInterface.TAG_IMAGE_LENGTH))
            dest.setAttribute(ExifInterface.TAG_IMAGE_UNIQUE_ID, src.getAttribute(ExifInterface.TAG_IMAGE_UNIQUE_ID))
            dest.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, src.getAttribute(ExifInterface.TAG_IMAGE_WIDTH))
            dest.setAttribute(ExifInterface.TAG_INTEROPERABILITY_INDEX, src.getAttribute(ExifInterface.TAG_INTEROPERABILITY_INDEX))
            dest.setAttribute(ExifInterface.TAG_ISO_SPEED, src.getAttribute(ExifInterface.TAG_ISO_SPEED))
            dest.setAttribute(ExifInterface.TAG_ISO_SPEED_LATITUDE_YYY, src.getAttribute(ExifInterface.TAG_ISO_SPEED_LATITUDE_YYY))
            dest.setAttribute(ExifInterface.TAG_ISO_SPEED_LATITUDE_ZZZ, src.getAttribute(ExifInterface.TAG_ISO_SPEED_LATITUDE_ZZZ))
            dest.setAttribute(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT, src.getAttribute(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT))
            dest.setAttribute(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH, src.getAttribute(ExifInterface.TAG_JPEG_INTERCHANGE_FORMAT_LENGTH))
            dest.setAttribute(ExifInterface.TAG_LENS_MAKE, src.getAttribute(ExifInterface.TAG_LENS_MAKE))
            dest.setAttribute(ExifInterface.TAG_LENS_MODEL, src.getAttribute(ExifInterface.TAG_LENS_MODEL))
            dest.setAttribute(ExifInterface.TAG_LENS_SERIAL_NUMBER, src.getAttribute(ExifInterface.TAG_LENS_SERIAL_NUMBER))
            dest.setAttribute(ExifInterface.TAG_LENS_SPECIFICATION, src.getAttribute(ExifInterface.TAG_LENS_SPECIFICATION))
            dest.setAttribute(ExifInterface.TAG_LIGHT_SOURCE, src.getAttribute(ExifInterface.TAG_LIGHT_SOURCE))
            dest.setAttribute(ExifInterface.TAG_MAKE, src.getAttribute(ExifInterface.TAG_MAKE))
            dest.setAttribute(ExifInterface.TAG_MAKER_NOTE, src.getAttribute(ExifInterface.TAG_MAKER_NOTE))
            dest.setAttribute(ExifInterface.TAG_MAX_APERTURE_VALUE, src.getAttribute(ExifInterface.TAG_MAX_APERTURE_VALUE))
            dest.setAttribute(ExifInterface.TAG_METERING_MODE, src.getAttribute(ExifInterface.TAG_METERING_MODE))
            dest.setAttribute(ExifInterface.TAG_MODEL, src.getAttribute(ExifInterface.TAG_MODEL))
            dest.setAttribute(ExifInterface.TAG_NEW_SUBFILE_TYPE, src.getAttribute(ExifInterface.TAG_NEW_SUBFILE_TYPE))
            dest.setAttribute(ExifInterface.TAG_OECF, src.getAttribute(ExifInterface.TAG_OECF))
            dest.setAttribute(ExifInterface.TAG_ORF_ASPECT_FRAME, src.getAttribute(ExifInterface.TAG_ORF_ASPECT_FRAME))
            dest.setAttribute(ExifInterface.TAG_ORF_PREVIEW_IMAGE_LENGTH, src.getAttribute(ExifInterface.TAG_ORF_PREVIEW_IMAGE_LENGTH))
            dest.setAttribute(ExifInterface.TAG_ORF_PREVIEW_IMAGE_START, src.getAttribute(ExifInterface.TAG_ORF_PREVIEW_IMAGE_START))
            dest.setAttribute(ExifInterface.TAG_ORF_THUMBNAIL_IMAGE, src.getAttribute(ExifInterface.TAG_ORF_THUMBNAIL_IMAGE))
            dest.setAttribute(ExifInterface.TAG_ORIENTATION, src.getAttribute(ExifInterface.TAG_ORIENTATION))
            dest.setAttribute(ExifInterface.TAG_PHOTOGRAPHIC_SENSITIVITY, src.getAttribute(ExifInterface.TAG_PHOTOGRAPHIC_SENSITIVITY))
            dest.setAttribute(ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION, src.getAttribute(ExifInterface.TAG_PHOTOMETRIC_INTERPRETATION))
            dest.setAttribute(ExifInterface.TAG_PIXEL_X_DIMENSION, src.getAttribute(ExifInterface.TAG_PIXEL_X_DIMENSION))
            dest.setAttribute(ExifInterface.TAG_PIXEL_Y_DIMENSION, src.getAttribute(ExifInterface.TAG_PIXEL_Y_DIMENSION))
            dest.setAttribute(ExifInterface.TAG_PLANAR_CONFIGURATION, src.getAttribute(ExifInterface.TAG_PLANAR_CONFIGURATION))
            dest.setAttribute(ExifInterface.TAG_PRIMARY_CHROMATICITIES, src.getAttribute(ExifInterface.TAG_PRIMARY_CHROMATICITIES))
            dest.setAttribute(ExifInterface.TAG_RECOMMENDED_EXPOSURE_INDEX, src.getAttribute(ExifInterface.TAG_RECOMMENDED_EXPOSURE_INDEX))
            dest.setAttribute(ExifInterface.TAG_REFERENCE_BLACK_WHITE, src.getAttribute(ExifInterface.TAG_REFERENCE_BLACK_WHITE))
            dest.setAttribute(ExifInterface.TAG_RELATED_SOUND_FILE, src.getAttribute(ExifInterface.TAG_RELATED_SOUND_FILE))
            dest.setAttribute(ExifInterface.TAG_RESOLUTION_UNIT, src.getAttribute(ExifInterface.TAG_RESOLUTION_UNIT))
            dest.setAttribute(ExifInterface.TAG_ROWS_PER_STRIP, src.getAttribute(ExifInterface.TAG_ROWS_PER_STRIP))
            dest.setAttribute(ExifInterface.TAG_RW2_ISO, src.getAttribute(ExifInterface.TAG_RW2_ISO))
            dest.setAttribute(ExifInterface.TAG_RW2_JPG_FROM_RAW, src.getAttribute(ExifInterface.TAG_RW2_JPG_FROM_RAW))
            dest.setAttribute(ExifInterface.TAG_RW2_SENSOR_BOTTOM_BORDER, src.getAttribute(ExifInterface.TAG_RW2_SENSOR_BOTTOM_BORDER))
            dest.setAttribute(ExifInterface.TAG_RW2_SENSOR_LEFT_BORDER, src.getAttribute(ExifInterface.TAG_RW2_SENSOR_LEFT_BORDER))
            dest.setAttribute(ExifInterface.TAG_RW2_SENSOR_RIGHT_BORDER, src.getAttribute(ExifInterface.TAG_RW2_SENSOR_RIGHT_BORDER))
            dest.setAttribute(ExifInterface.TAG_RW2_SENSOR_TOP_BORDER, src.getAttribute(ExifInterface.TAG_RW2_SENSOR_TOP_BORDER))
            dest.setAttribute(ExifInterface.TAG_SAMPLES_PER_PIXEL, src.getAttribute(ExifInterface.TAG_SAMPLES_PER_PIXEL))
            dest.setAttribute(ExifInterface.TAG_SATURATION, src.getAttribute(ExifInterface.TAG_SATURATION))
            dest.setAttribute(ExifInterface.TAG_SCENE_CAPTURE_TYPE, src.getAttribute(ExifInterface.TAG_SCENE_CAPTURE_TYPE))
            dest.setAttribute(ExifInterface.TAG_SCENE_TYPE, src.getAttribute(ExifInterface.TAG_SCENE_TYPE))
            dest.setAttribute(ExifInterface.TAG_SENSING_METHOD, src.getAttribute(ExifInterface.TAG_SENSING_METHOD))
            dest.setAttribute(ExifInterface.TAG_SENSITIVITY_TYPE, src.getAttribute(ExifInterface.TAG_SENSITIVITY_TYPE))
            dest.setAttribute(ExifInterface.TAG_SHARPNESS, src.getAttribute(ExifInterface.TAG_SHARPNESS))
            dest.setAttribute(ExifInterface.TAG_SHUTTER_SPEED_VALUE, src.getAttribute(ExifInterface.TAG_SHUTTER_SPEED_VALUE))
            dest.setAttribute(ExifInterface.TAG_SOFTWARE, src.getAttribute(ExifInterface.TAG_SOFTWARE))
            dest.setAttribute(ExifInterface.TAG_SPATIAL_FREQUENCY_RESPONSE, src.getAttribute(ExifInterface.TAG_SPATIAL_FREQUENCY_RESPONSE))
            dest.setAttribute(ExifInterface.TAG_SPECTRAL_SENSITIVITY, src.getAttribute(ExifInterface.TAG_SPECTRAL_SENSITIVITY))
            dest.setAttribute(ExifInterface.TAG_STANDARD_OUTPUT_SENSITIVITY, src.getAttribute(ExifInterface.TAG_STANDARD_OUTPUT_SENSITIVITY))
            dest.setAttribute(ExifInterface.TAG_STRIP_BYTE_COUNTS, src.getAttribute(ExifInterface.TAG_STRIP_BYTE_COUNTS))
            dest.setAttribute(ExifInterface.TAG_STRIP_OFFSETS, src.getAttribute(ExifInterface.TAG_STRIP_OFFSETS))
            dest.setAttribute(ExifInterface.TAG_SUBFILE_TYPE, src.getAttribute(ExifInterface.TAG_SUBFILE_TYPE))
            dest.setAttribute(ExifInterface.TAG_SUBJECT_AREA, src.getAttribute(ExifInterface.TAG_SUBJECT_AREA))
            dest.setAttribute(ExifInterface.TAG_SUBJECT_DISTANCE, src.getAttribute(ExifInterface.TAG_SUBJECT_DISTANCE))
            dest.setAttribute(ExifInterface.TAG_SUBJECT_DISTANCE_RANGE, src.getAttribute(ExifInterface.TAG_SUBJECT_DISTANCE_RANGE))
            dest.setAttribute(ExifInterface.TAG_SUBJECT_LOCATION, src.getAttribute(ExifInterface.TAG_SUBJECT_LOCATION))
            dest.setAttribute(ExifInterface.TAG_SUBSEC_TIME, src.getAttribute(ExifInterface.TAG_SUBSEC_TIME))
            dest.setAttribute(ExifInterface.TAG_SUBSEC_TIME_DIGITIZED, src.getAttribute(ExifInterface.TAG_SUBSEC_TIME_DIGITIZED))
            dest.setAttribute(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL, src.getAttribute(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL))
            dest.setAttribute(ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH, src.getAttribute(ExifInterface.TAG_THUMBNAIL_IMAGE_LENGTH))
            dest.setAttribute(ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH, src.getAttribute(ExifInterface.TAG_THUMBNAIL_IMAGE_WIDTH))
            dest.setAttribute(ExifInterface.TAG_TRANSFER_FUNCTION, src.getAttribute(ExifInterface.TAG_TRANSFER_FUNCTION))
            dest.setAttribute(ExifInterface.TAG_USER_COMMENT, src.getAttribute(ExifInterface.TAG_USER_COMMENT))
            dest.setAttribute(ExifInterface.TAG_WHITE_BALANCE, src.getAttribute(ExifInterface.TAG_WHITE_BALANCE))
            dest.setAttribute(ExifInterface.TAG_WHITE_POINT, src.getAttribute(ExifInterface.TAG_WHITE_POINT))
            dest.setAttribute(ExifInterface.TAG_XMP, src.getAttribute(ExifInterface.TAG_XMP))
            dest.setAttribute(ExifInterface.TAG_X_RESOLUTION, src.getAttribute(ExifInterface.TAG_X_RESOLUTION))
            dest.setAttribute(ExifInterface.TAG_Y_CB_CR_COEFFICIENTS, src.getAttribute(ExifInterface.TAG_Y_CB_CR_COEFFICIENTS))
            dest.setAttribute(ExifInterface.TAG_Y_CB_CR_POSITIONING, src.getAttribute(ExifInterface.TAG_Y_CB_CR_POSITIONING))
            dest.setAttribute(ExifInterface.TAG_Y_CB_CR_SUB_SAMPLING, src.getAttribute(ExifInterface.TAG_Y_CB_CR_SUB_SAMPLING))
            dest.setAttribute(ExifInterface.TAG_Y_RESOLUTION, src.getAttribute(ExifInterface.TAG_Y_RESOLUTION))

            dest.saveAttributes()
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18276440

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档