From 29652199074d6cd7a2332abf590480fd87f80286 Mon Sep 17 00:00:00 2001 From: Thomas BOY Date: Tue, 20 Jan 2015 11:10:46 +0100 Subject: [PATCH] Resolution du probleme de preview sur tablette blanche --- .../src/org/geneanet/customcamera/CameraActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java b/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java index 25dc33c..5d1e13e 100644 --- a/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java +++ b/src/android/customCamera/src/org/geneanet/customcamera/CameraActivity.java @@ -659,7 +659,7 @@ public class CameraActivity extends Activity { try { ByteArrayOutputStream stream = new ByteArrayOutputStream(); photoTaken.compress( - CompressFormat.JPEG, this.getIntent().getIntExtra("quality", 100), stream); + CompressFormat.JPEG, this.getIntent().getIntExtra("quality", 100), stream); if (this.getIntent().getBooleanExtra("saveInGallery", false)) { // Get path picture to storage. @@ -774,10 +774,10 @@ public class CameraActivity extends Activity { // Change size ImageView. float ratioX = (float) displayWidthPx / (float) widthBackground; float ratioY = (float) displayHeightPx / (float) heightBackground; - if (ratioX < ratioY && ratioX < 1) { + if (ratioX < ratioY) { newBitmap = Bitmap.createScaledBitmap(photoTaken, (int) displayWidthPx, (int) (ratioX * heightBackground), false); - } else if (ratioX >= ratioY && ratioY < 1) { + } else if (ratioX >= ratioY) { newBitmap = Bitmap.createScaledBitmap(photoTaken, (int) (ratioY * widthBackground), (int) displayHeightPx, false); }