summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-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 aaa7ca77b..e41c77762 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;