Skip to content

Commit

Permalink
Merge pull request #115 from IsseiAoki/1.1.6
Browse files Browse the repository at this point in the history
1.1.6
  • Loading branch information
igreenwood committed Aug 7, 2017
2 parents 1c206b6 + 2fec2da commit 2161190
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
Change Log
=========
## Version 1.1.6
* Fix UnsupportedOperationException(#113)

## Version 1.1.5
* Fix EXIF data bug
* Fix OOM in onSaveInstanceState(CropImageView does not save bitmap internally anymore.)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -29,7 +29,7 @@ Supported on API Level 10 and above.
* [CropMode](#cropmode)
* [MinimumFrameSize](#minimumframesize)
* [InitialFrameScale](#initialframescale)
* [Save and Restore FrameRect](#save-and-restoreframerect)
* [Save and Restore FrameRect](#save-and-restore-framerect)
* [Color](#color)
* [Stroke Weight and Handle Size](#stroke-weight-and-handle-size)
* [Handle Touch Padding](#handle-touch-padding)
Expand All @@ -51,7 +51,7 @@ repositories {
jcenter()
}
dependencies {
compile 'com.isseiaoki:simplecropview:1.1.5'
compile 'com.isseiaoki:simplecropview:1.1.6'
}
```

Expand Down
6 changes: 3 additions & 3 deletions simplecropview/build.gradle
Expand Up @@ -14,8 +14,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 25
versionCode 23
versionName "1.1.5"
versionCode 24
versionName "1.1.6"
consumerProguardFiles 'proguard-rules.pro'
}

Expand All @@ -31,7 +31,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

group = 'com.isseiaoki'
version = '1.1.5'
version = '1.1.6'
def siteUrl = 'https://github.com/IsseiAoki/SimpleCropView'
def gitUrl = 'https://github.com/IsseiAoki/SimpleCropView.git'
Properties properties = new Properties()
Expand Down
Expand Up @@ -27,7 +27,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

import static android.graphics.Bitmap.createBitmap;
Expand Down Expand Up @@ -60,8 +60,8 @@
*
* =========================================
*/
@SuppressWarnings("deprecation") public static void copyExifInfo(Context context, Uri sourceUri,
Uri saveUri, int outputWidth, int outputHeight) {
public static void copyExifInfo(Context context, Uri sourceUri, Uri saveUri, int outputWidth,
int outputHeight) {
if (sourceUri == null || saveUri == null) return;
try {
File sourceFile = Utils.getFileFromUri(context, sourceUri);
Expand All @@ -73,25 +73,45 @@
String savePath = saveFile.getAbsolutePath();

ExifInterface sourceExif = new ExifInterface(sourcePath);
List<String> tags = Arrays.asList(ExifInterface.TAG_DATETIME, ExifInterface.TAG_FLASH,
ExifInterface.TAG_FOCAL_LENGTH, ExifInterface.TAG_GPS_ALTITUDE,
ExifInterface.TAG_GPS_ALTITUDE_REF, ExifInterface.TAG_GPS_DATESTAMP,
ExifInterface.TAG_GPS_LATITUDE, ExifInterface.TAG_GPS_LATITUDE_REF,
ExifInterface.TAG_GPS_LONGITUDE, ExifInterface.TAG_GPS_LONGITUDE_REF,
ExifInterface.TAG_GPS_PROCESSING_METHOD, ExifInterface.TAG_GPS_TIMESTAMP,
ExifInterface.TAG_MAKE, ExifInterface.TAG_MODEL, ExifInterface.TAG_WHITE_BALANCE);
List<String> tags = new ArrayList<>();
tags.add(ExifInterface.TAG_DATETIME);
tags.add(ExifInterface.TAG_FLASH);
tags.add(ExifInterface.TAG_FOCAL_LENGTH);
tags.add(ExifInterface.TAG_GPS_ALTITUDE);
tags.add(ExifInterface.TAG_GPS_ALTITUDE_REF);
tags.add(ExifInterface.TAG_GPS_DATESTAMP);
tags.add(ExifInterface.TAG_GPS_LATITUDE);
tags.add(ExifInterface.TAG_GPS_LATITUDE_REF);
tags.add(ExifInterface.TAG_GPS_LONGITUDE);
tags.add(ExifInterface.TAG_GPS_LONGITUDE_REF);
tags.add(ExifInterface.TAG_GPS_PROCESSING_METHOD);
tags.add(ExifInterface.TAG_GPS_TIMESTAMP);
tags.add(ExifInterface.TAG_MAKE);
tags.add(ExifInterface.TAG_MODEL);
tags.add(ExifInterface.TAG_WHITE_BALANCE);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
tags.add(ExifInterface.TAG_EXPOSURE_TIME);
//noinspection deprecation
tags.add(ExifInterface.TAG_APERTURE);
//noinspection deprecation
tags.add(ExifInterface.TAG_ISO);
tags.add(ExifInterface.TAG_EXPOSURE_TIME);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tags.add(ExifInterface.TAG_DATETIME_DIGITIZED);
tags.add(ExifInterface.TAG_SUBSEC_TIME);
//noinspection deprecation
tags.add(ExifInterface.TAG_SUBSEC_TIME_DIG);
//noinspection deprecation
tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIG);
tags.add(ExifInterface.TAG_SUBSEC_TIME);
tags.add(ExifInterface.TAG_DATETIME_DIGITIZED);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
tags.add(ExifInterface.TAG_F_NUMBER);
tags.add(ExifInterface.TAG_ISO_SPEED_RATINGS);
tags.add(ExifInterface.TAG_SUBSEC_TIME_DIGITIZED);
tags.add(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL);
}

ExifInterface saveExif = new ExifInterface(savePath);
Expand All @@ -104,7 +124,8 @@
}
saveExif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, String.valueOf(outputWidth));
saveExif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, String.valueOf(outputHeight));
saveExif.setAttribute(ExifInterface.TAG_ORIENTATION, "0");
saveExif.setAttribute(ExifInterface.TAG_ORIENTATION,
String.valueOf(ExifInterface.ORIENTATION_UNDEFINED));

saveExif.saveAttributes();
} catch (IOException e) {
Expand Down

0 comments on commit 2161190

Please sign in to comment.