9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-02 00:07:24 +08:00

Ajout de la possibilité de régler la qualité de la photo.

This commit is contained in:
Christophe BOUCAUT
2015-01-19 17:21:39 +01:00
parent a991e3fb4c
commit 1635210b3c
3 changed files with 8 additions and 3 deletions
+3
View File
@@ -55,6 +55,9 @@ public class CameraLauncher extends CordovaPlugin {
intent.putExtra("saveInGallery", args.getBoolean(2));
intent.putExtra("cameraBackgroundColor", args.getString(3));
intent.putExtra("cameraBackgroundColorPressed", args.getString(4));
if (args.getInt(5) >= 0 && args.getInt(5) <= 100) {
intent.putExtra("quality", args.getInt(5));
}
cordova.startActivityForResult((CordovaPlugin) this, intent, CameraLauncher.REQUEST_CODE);
@@ -658,7 +658,7 @@ public class CameraActivity extends Activity {
try {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
photoTaken.compress(CompressFormat.JPEG, 70, stream);
photoTaken.compress(CompressFormat.JPEG, this.getIntent().getIntExtra("quality", 100), stream);
if (this.getIntent().getBooleanExtra("saveInGallery", false)) {
// Get path picture to storage.