Skip to content

Commit

Permalink
Issue nostra13#1026 - Check markSupported()
Browse files Browse the repository at this point in the history
  • Loading branch information
nostra13 committed Jul 2, 2015
1 parent a91f2f3 commit 3acca4a
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,15 @@ protected Options prepareDecodingOptions(ImageSize imageSize, ImageDecodingInfo
}

protected InputStream resetStream(InputStream imageStream, ImageDecodingInfo decodingInfo) throws IOException {
try {
imageStream.reset();
} catch (IOException e) {
IoUtils.closeSilently(imageStream);
imageStream = getImageStream(decodingInfo);
if (imageStream.markSupported()) {
try {
imageStream.reset();
return imageStream;
} catch (IOException ignored) {
}
}
return imageStream;
IoUtils.closeSilently(imageStream);
return getImageStream(decodingInfo);
}

protected Bitmap considerExactScaleAndOrientatiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo,
Expand Down Expand Up @@ -247,4 +249,4 @@ protected ImageFileInfo(ImageSize imageSize, ExifInfo exif) {
this.exif = exif;
}
}
}
}

0 comments on commit 3acca4a

Please sign in to comment.