Skip to content

Commit

Permalink
Update CameraLauncher.java
Browse files Browse the repository at this point in the history
Includes the pull request apache#331 (apacheGH-329) from the main fork
Includes the pull request apache#238 from the main fork
  • Loading branch information
Tilexou authored Nov 6, 2018
1 parent 9746ab8 commit 0213690
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/android/CameraLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
// read exifData of source
exifData = new ExifHelper();
exifData.createInFile(filePath);
exifData.readExifData();
// Use ExifInterface to pull rotation information
if (this.correctOrientation) {
ExifInterface exif = new ExifInterface(filePath);
Expand Down Expand Up @@ -1117,8 +1118,8 @@ private Bitmap getScaledAndRotatedBitmap(String imageUrl) throws IOException {
* @return
*/
public int[] calculateAspectRatio(int origWidth, int origHeight) {
int newWidth = this.targetWidth;
int newHeight = this.targetHeight;
int newWidth = Math.min(this.targetWidth, origWidth);
int newHeight = Math.min(this.targetHeight, origHeight);

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

0 comments on commit 0213690

Please sign in to comment.