mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Fixing quality bug in Camera
This commit is contained in:
parent
8f18dae2c1
commit
b65a0b1bd6
@ -13,7 +13,7 @@ public class CameraLauncher {
|
||||
|
||||
private WebView mAppView;
|
||||
private DroidGap mGap;
|
||||
int quality;
|
||||
int mQuality;
|
||||
|
||||
CameraLauncher(WebView view, DroidGap gap)
|
||||
{
|
||||
@ -23,7 +23,8 @@ public class CameraLauncher {
|
||||
|
||||
public void takePicture(int quality)
|
||||
{
|
||||
mGap.startCamera(quality);
|
||||
mQuality = quality;
|
||||
mGap.startCamera();
|
||||
}
|
||||
|
||||
/* Return Base64 Encoded String to Javascript */
|
||||
@ -31,7 +32,7 @@ public class CameraLauncher {
|
||||
{
|
||||
ByteArrayOutputStream jpeg_data = new ByteArrayOutputStream();
|
||||
try {
|
||||
if (bitmap.compress(CompressFormat.JPEG, quality, jpeg_data))
|
||||
if (bitmap.compress(CompressFormat.JPEG, mQuality, jpeg_data))
|
||||
{
|
||||
byte[] code = jpeg_data.toByteArray();
|
||||
byte[] output = Base64.encodeBase64(code);
|
||||
|
@ -350,7 +350,7 @@ public class DroidGap extends Activity {
|
||||
}
|
||||
|
||||
// This is required to start the camera activity! It has to come from the previous activity
|
||||
public void startCamera(int quality)
|
||||
public void startCamera()
|
||||
{
|
||||
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
|
||||
File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");
|
||||
|
Loading…
Reference in New Issue
Block a user