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);
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();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With