summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-11-09 12:04:00 -0800
committerJessica Wagantall <jwagantall@cyngn.com>2016-11-09 12:04:00 -0800
commit996c5b93d6e8d5f3e5d5248e08a32f401ebfcb28 (patch)
tree55ae2221ea34bc1bd0c3a407f89ed35e2bdd4212 /media
parent8ec45de6fca5d470f27a0272c2b84a112ef9d2e9 (diff)
parentef525e8d721a69310044eca14993df8b13ac1b14 (diff)
downloadframeworks_base-996c5b93d6e8d5f3e5d5248e08a32f401ebfcb28.zip
frameworks_base-996c5b93d6e8d5f3e5d5248e08a32f401ebfcb28.tar.gz
frameworks_base-996c5b93d6e8d5f3e5d5248e08a32f401ebfcb28.tar.bz2
Merge tag 'android-6.0.1_r74' into HEAD
CYNGNOS-3303 Android 6.0.1 release 74
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/ExifInterface.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 74bb55b..a2ccdc8 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -1039,6 +1039,7 @@ public class ExifInterface {
private int mThumbnailOffset;
private int mThumbnailLength;
private byte[] mThumbnailBytes;
+ private boolean mIsSupportedFile;
// Pattern to check non zero timestamp
private static final Pattern sNonZeroTimePattern = Pattern.compile(".*[1-9].*");
@@ -1337,9 +1338,11 @@ public class ExifInterface {
try {
InputStream in = new FileInputStream(mFilename);
getJpegAttributes(in);
+ mIsSupportedFile = true;
} catch (IOException e) {
// Ignore exceptions in order to keep the compatibility with the old versions of
// ExifInterface.
+ mIsSupportedFile = false;
Log.w(TAG, "Invalid image.", e);
} finally {
addDefaultValuesForCompatibility();
@@ -1368,6 +1371,10 @@ public class ExifInterface {
* and make a single call rather than multiple calls for each attribute.
*/
public void saveAttributes() throws IOException {
+ if (!mIsSupportedFile) {
+ throw new UnsupportedOperationException(
+ "ExifInterface only supports saving attributes on JPEG formats.");
+ }
// Keep the thumbnail in memory
mThumbnailBytes = getThumbnail();