aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Jacob <mjacob@union06.de>2013-05-23 19:43:25 +0200
committerMarco Jacob <mjacob@union06.de>2013-05-23 19:43:25 +0200
commit20bcca86fd5cbe8a38debd8ecee7f848d57e8426 (patch)
treed99fc4ccc2caf20c9ec405623ada08dfb80354f7
parent3f2ddfa7939ed9b17866f988e964577798c4c11d (diff)
downloadcgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.zip
cgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.tar.gz
cgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.tar.bz2
add final qualifier to vars
-rw-r--r--main/src/cgeo/geocaching/ImageSelectActivity.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/ImageSelectActivity.java b/main/src/cgeo/geocaching/ImageSelectActivity.java
index 2a87691..4329686 100644
--- a/main/src/cgeo/geocaching/ImageSelectActivity.java
+++ b/main/src/cgeo/geocaching/ImageSelectActivity.java
@@ -260,17 +260,17 @@ public class ImageSelectActivity extends AbstractActivity {
* @param filePath
* @return
*/
- private String writeScaledImage(String filePath) {
+ private String writeScaledImage(final String filePath) {
scaleChoiceIndex = scaleView.getSelectedItemPosition();
- int maxXY = getResources().getIntArray(R.array.log_image_scale_values)[scaleChoiceIndex];
+ final int maxXY = getResources().getIntArray(R.array.log_image_scale_values)[scaleChoiceIndex];
if (maxXY == 0) {
return filePath;
}
BitmapFactory.Options sizeOnlyOptions = new BitmapFactory.Options();
sizeOnlyOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filePath, sizeOnlyOptions);
- int myMaxXY = Math.max(sizeOnlyOptions.outHeight, sizeOnlyOptions.outWidth);
- int sampleSize = myMaxXY / maxXY;
+ final int myMaxXY = Math.max(sizeOnlyOptions.outHeight, sizeOnlyOptions.outWidth);
+ final int sampleSize = myMaxXY / maxXY;
Bitmap image;
if (sampleSize > 1) {
BitmapFactory.Options sampleOptions = new BitmapFactory.Options();
@@ -279,8 +279,9 @@ public class ImageSelectActivity extends AbstractActivity {
} else {
image = BitmapFactory.decodeFile(filePath);
}
- BitmapDrawable scaledImage = ImageHelper.scaleBitmapTo(image, maxXY, maxXY);
- String uploadFilename = getOutputImageFile().getPath();
+ final BitmapDrawable scaledImage = ImageHelper.scaleBitmapTo(image, maxXY, maxXY);
+ image = null;
+ final String uploadFilename = getOutputImageFile().getPath();
ImageHelper.storeBitmap(scaledImage.getBitmap(), Bitmap.CompressFormat.JPEG, 75, uploadFilename);
return uploadFilename;
}