summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2013-04-02 23:47:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-02 23:47:03 +0000
commit93d76a69aecf03e7ac7653bd088fe6bb64356ec1 (patch)
tree00dcd83510f2afca0305561c4dda0103c8bc2339 /gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
parente3961e715d17179849901f2274e046b925b1a058 (diff)
parent43b9c0c3fce9cb877ca73cb34917fb2c7556c4d4 (diff)
downloadandroid_packages_apps_Snap-93d76a69aecf03e7ac7653bd088fe6bb64356ec1.tar.gz
android_packages_apps_Snap-93d76a69aecf03e7ac7653bd088fe6bb64356ec1.tar.bz2
android_packages_apps_Snap-93d76a69aecf03e7ac7653bd088fe6bb64356ec1.zip
Merge "Speed improvements for ExifOutputStream." into gb-ub-photos-bryce
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java')
-rw-r--r--gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
index 2fef9ede0..a1cf0fc85 100644
--- a/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
+++ b/gallerycommon/src/com/android/gallery3d/exif/ExifInterface.java
@@ -20,6 +20,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.SparseIntArray;
+import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
@@ -758,7 +759,7 @@ public class ExifInterface {
}
InputStream is = null;
try {
- is = (InputStream) new FileInputStream(inFileName);
+ is = (InputStream) new BufferedInputStream(new FileInputStream(inFileName));
readExif(is);
} catch (IOException e) {
closeSilently(is);
@@ -800,6 +801,7 @@ public class ExifInterface {
}
OutputStream s = getExifWriterStream(exifOutStream);
s.write(jpeg, 0, jpeg.length);
+ s.flush();
}
/**
@@ -817,6 +819,7 @@ public class ExifInterface {
}
OutputStream s = getExifWriterStream(exifOutStream);
bmap.compress(Bitmap.CompressFormat.JPEG, 90, s);
+ s.flush();
}
/**
@@ -834,6 +837,7 @@ public class ExifInterface {
}
OutputStream s = getExifWriterStream(exifOutStream);
doExifStreamIO(jpegStream, s);
+ s.flush();
}
/**
@@ -1010,7 +1014,7 @@ public class ExifInterface {
boolean ret;
try {
File temp = new File(filename);
- is = new FileInputStream(temp);
+ is = new BufferedInputStream(new FileInputStream(temp));
// Parse beginning of APP1 in exif to find size of exif header.
ExifParser parser = null;