Android Camera setJpegQuality ignored

It seems that the setJpegQuality method of Camera.Parameters is ignored, at least on the devices I've tried it with (Nexus S, Galaxy S2).

Does it work for anyone else, or is this a known issue, or am I doing something wrong, or... ?

Code for setting parameters below. jpeg quality 1 is very distinctive, so it's very easy to determine visually whether it's working... and it isn't! Other parameters set here (e.g. sepia) work.

    camera = Camera.open();
    final Camera.Parameters parameters = camera.getParameters();
    parameters.setJpegQuality(1);
    parameters.setPictureFormat(ImageFormat.JPEG);
    // Let's set a SEPIA effect, just to verify these parameters are working at all!
    parameters.setColorEffect(Camera.Parameters.EFFECT_SEPIA);
    // I've seen this syntax too on the internet, presumably it's legacy.
    parameters.set("jpeg-quality", 1);
    camera.setParameters(parameters);

Answers


Set all attributes of the picture:

parameters.setPreviewSize(854, 480);  // (h, w)
   parameters.setPictureFormat(ImageFormat.JPEG);
   parameters.set("jpeg-quality", 100);
   parameters.set("orientation", "landscape");
   parameters.set("rotation", 90);
   mCamera.setParameters(parameters);
   mCamera.startPreview();

Need Your Help

EF 4.1 Code First - OnModelCreating call time

.net entity-framework ef-code-first entity-framework-4.1

When I debug my application this method seems not to be executing in constructor context of DbContext. So when it is called then?

What is the difference between atomic and critical in OpenMP?

openmp atomic critical-section

What is the difference between atomic and critical in OpenMP?