What steps will reproduce the problem?
1. Find the largest supported camera size that matches the aspect ratio of the
preview / glass screen
2. Use takePicture to capture a JPEG image
What is the expected output? What do you see instead?
I expect to see an undistorted image with the specified size. Instead i get an
image that has been vertically squashed.
What version of the product are you using? On what operating system?
XE18.11
Please provide any additional information below.
I'm attempting to set the image size to match the preview aspect ratio with the
following code:
Parameters parameters = mCamera.getParameters();
// Quirk required for Google Glass
parameters.setPreviewFpsRange(10000, 10000);
int previewWidth = mPreview.getWidth();
int previewHeight = mPreview.getHeight();
if (0 == previewWidth || 0 == previewHeight) {
previewWidth = 640;
previewHeight = 360;
}
Iterable<Size> sizes = parameters.getSupportedPictureSizes();
sizes = CameraUtils.getAspectRatioMatches(sizes, previewWidth, previewHeight);
Size targetSize = CameraUtils.getBiggestSize(sizes);
if (null == targetSize) {
CameraUtils.getBiggestSize(parameters.getSupportedPictureSizes());
}
parameters.setPictureSize(targetSize.width, targetSize.height);
mCamera.setParameters(parameters);
Original issue reported on code.google.com by bda...@saintandreas.org on 23 Jun 2014 at 6:13
Original issue reported on code.google.com by
bda...@saintandreas.org
on 23 Jun 2014 at 6:13Attachments: