Skip to content

Commit f92cf86

Browse files
authored
Merge pull request #550 from uncledoc/master
added exception when file is not a picture (as example - video file)
2 parents d3d92fa + cba310c commit f92cf86

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cropper/src/main/java/com/theartofdev/edmodo/cropper/BitmapUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ static BitmapSampled decodeSampledBitmap(Context context, Uri uri, int reqWidth,
114114
// First decode with inJustDecodeBounds=true to check dimensions
115115
BitmapFactory.Options options = decodeImageForOption(resolver, uri);
116116

117+
if(options.outWidth == -1 && options.outHeight == -1)
118+
throw new RuntimeException("File is not a picture");
119+
117120
// Calculate inSampleSize
118121
options.inSampleSize =
119122
Math.max(

0 commit comments

Comments
 (0)