From 2624bca797eaa140b2602909913c19fff548e60c Mon Sep 17 00:00:00 2001 From: mingwax Date: Wed, 1 Mar 2017 16:33:30 +0800 Subject: SnapdragonCamera: Fix live shot image stretch when recording is 4K (1) When the video is seted 4K UHD, the mVideoSnapshotSize should be setted the similar aspect ratio to ensure the picture which live shotted is not stretched. (2) Fixed the width and height of the panorama image CRs-Fixed: 2012167 Change-Id: I15d139c6d558923d6b4a32ee3613c44c7a974129 --- src/com/android/camera/CaptureModule.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100755 => 100644 src/com/android/camera/CaptureModule.java (limited to 'src/com/android/camera/CaptureModule.java') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java old mode 100755 new mode 100644 index e4c162a5b..d2545f448 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -4446,8 +4446,14 @@ public class CaptureModule implements CameraModule, PhotoController, private Size getMaxPictureSizeLessThan4k() { Size[] sizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(), ImageFormat.JPEG); + float ratio = (float) mVideoSize.getWidth() / mVideoSize.getHeight(); for (Size size : sizes) { - if (!is4kSize(size)) return size; + if (!is4kSize(size)) { + float pictureRatio = (float) size.getWidth() / size.getHeight(); + if (Math.abs(pictureRatio - ratio) < 0.01) { + return size; + } + } } return sizes[sizes.length - 1]; } -- cgit v1.2.3