summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-11-30 10:43:59 +0100
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 22:00:45 +0200
commitd17f129b9b72a30b5bcfe03d39901792e0e708c4 (patch)
treefd053c81435ceb23d8292848d8207421e36efcc4
parentc071c830f2c72cfa15d5ff254e9ff038a3e1e9e6 (diff)
downloadandroid_packages_apps_Snap-d17f129b9b72a30b5bcfe03d39901792e0e708c4.zip
android_packages_apps_Snap-d17f129b9b72a30b5bcfe03d39901792e0e708c4.tar.gz
android_packages_apps_Snap-d17f129b9b72a30b5bcfe03d39901792e0e708c4.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;