File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -994,6 +994,7 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
994
994
// read exifData of source
995
995
exifData = new ExifHelper ();
996
996
exifData .createInFile (filePath );
997
+ exifData .readExifData ();
997
998
// Use ExifInterface to pull rotation information
998
999
if (this .correctOrientation ) {
999
1000
ExifInterface exif = new ExifInterface (filePath );
@@ -1117,8 +1118,8 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
1117
1118
* @return
1118
1119
*/
1119
1120
public int [] calculateAspectRatio (int origWidth , int origHeight ) {
1120
- int newWidth = this .targetWidth ;
1121
- int newHeight = this .targetHeight ;
1121
+ int newWidth = Math . min ( this .targetWidth , origWidth ) ;
1122
+ int newHeight = Math . min ( this .targetHeight , origHeight ) ;
1122
1123
1123
1124
// If no new width or height were specified return the original bitmap
1124
1125
if (newWidth <= 0 && newHeight <= 0 ) {
You can’t perform that action at this time.
0 commit comments