summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-11-30 10:43:59 +0100
committerMichael Bestas <mikeioannina@gmail.com>2016-12-23 00:36:15 -0800
commitc2427aa7d2ef76dc4dd586a3328cd1f13a3f43cd (patch)
tree5033a8e2d94a3bf810d955520be1969c1cb4a06f
parent95b4bc976f57ea41048f208e0276fe841aaf37c7 (diff)
downloadandroid_packages_apps_Snap-c2427aa7d2ef76dc4dd586a3328cd1f13a3f43cd.zip
android_packages_apps_Snap-c2427aa7d2ef76dc4dd586a3328cd1f13a3f43cd.tar.gz
android_packages_apps_Snap-c2427aa7d2ef76dc4dd586a3328cd1f13a3f43cd.tar.bz2
Always set JPEG quality.
Don't skip it (and the JPEG picture size estimation) under arbitrary conditions. Change-Id: Iee89e56ffffd3f029bc042a07cf4df18fd8fda57
-rw-r--r--src/com/android/camera/PhotoModule.java31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index aaa7ca7..e41c777 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -3218,27 +3218,16 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
String jpegQuality = mPreferences.getString(
CameraSettings.KEY_JPEG_QUALITY,
mActivity.getString(R.string.pref_camera_jpegquality_default));
- //mUnsupportedJpegQuality = false;
- Size pic_size = mParameters.getPictureSize();
- if (pic_size == null) {
- Log.e(TAG, "error getPictureSize: size is null");
- }
- else{
- if("100".equals(jpegQuality) && (pic_size.width >= 3200)){
- //mUnsupportedJpegQuality = true;
- }else {
- mParameters.setJpegQuality(JpegEncodingQualityMappings.getQualityNumber(jpegQuality));
- int jpegFileSize = estimateJpegFileSize(pic_size, jpegQuality);
- if (jpegFileSize != mJpegFileSizeEstimation) {
- mJpegFileSizeEstimation = jpegFileSize;
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- updateRemainingPhotos();
- }
- });
+ mParameters.setJpegQuality(JpegEncodingQualityMappings.getQualityNumber(jpegQuality));
+ int jpegFileSize = estimateJpegFileSize(mParameters.getPictureSize(), jpegQuality);
+ if (jpegFileSize != mJpegFileSizeEstimation) {
+ mJpegFileSizeEstimation = jpegFileSize;
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ updateRemainingPhotos();
}
- }
+ });
}
// Set Selectable Zone Af parameter.
@@ -3717,7 +3706,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
}
}
- if (ratio == 0) {
+ if (ratio == 0 || size == null) {
return 0;
} else {
return size.width * size.height * 3 / ratio;