I'm building a custom camera application for Android. The Camera.Parameters API contains methods like setPreviewSize
or setPictureSize
, that are working well.
But I am trying to use setJpegQuality(int) parameter:
Camera cam = getCameraInstance();
if(cam == null){
setResult(INSTANCE_ERROR);
finish();
}
params = cam.getParameters();
params.setJpegQuality(jpegQuality);
cam.setParameters(params);
I am testing my application on 3 different devices : an HTC Desire Z, a Galaxy S2 and a Galaxy S4.
setJpegQuality
is working on HTC (Android 2.2.1
) and on Galaxy S2 (4.1.2
), but fails on Galaxy S4 device (4.2.2
).
So my question : Is this function deprecated ? Is there another way to set picture quality ? On the Developer documentation it doesnt seems to be a deprecated function so i am a little confused...
I also tried
params.set("jpeg-quality", jpegQuality);
But its the same :(
Thanks for the answers.
Sorry I didnt see answers finaly come :) I dont even use this not working parameters anymore
I found a solution to set the quality of my picture, when i save it as file :
Hope it helps