Skip to content

Commit 0213690

Browse files
authored
Update CameraLauncher.java
Includes the pull request apache#331 (apacheGH-329) from the main fork Includes the pull request apache#238 from the main fork
1 parent 9746ab8 commit 0213690

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/android/CameraLauncher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
994994
// read exifData of source
995995
exifData = new ExifHelper();
996996
exifData.createInFile(filePath);
997+
exifData.readExifData();
997998
// Use ExifInterface to pull rotation information
998999
if (this.correctOrientation) {
9991000
ExifInterface exif = new ExifInterface(filePath);
@@ -1117,8 +1118,8 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
11171118
* @return
11181119
*/
11191120
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);
11221123

11231124
// If no new width or height were specified return the original bitmap
11241125
if (newWidth <= 0 && newHeight <= 0) {

0 commit comments

Comments
 (0)