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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user