Bitmap OOM and rotation fixes

// FREEBIE
This commit is contained in:
Jake McGinty
2014-12-29 16:40:37 -08:00
parent bec5e45605
commit 348352cc71
3 changed files with 22 additions and 4 deletions

View File

@@ -153,7 +153,16 @@ public class Exif {
private static boolean read(InputStream is, byte[] buf, int length) {
try {
return is.read(buf, 0, length) == length;
int read;
int totalRead = 0;
while (totalRead != length) {
if ((read = is.read(buf, totalRead, length - totalRead)) < 0) {
Log.w(TAG, "stream EOF'd prematurely");
return false;
}
totalRead += read;
}
return true;
} catch (IOException ex) {
return false;
}