diff options
| author | Marco Jacob <mjacob@union06.de> | 2013-05-23 19:43:25 +0200 |
|---|---|---|
| committer | Marco Jacob <mjacob@union06.de> | 2013-05-23 19:43:25 +0200 |
| commit | 20bcca86fd5cbe8a38debd8ecee7f848d57e8426 (patch) | |
| tree | d99fc4ccc2caf20c9ec405623ada08dfb80354f7 | |
| parent | 3f2ddfa7939ed9b17866f988e964577798c4c11d (diff) | |
| download | cgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.zip cgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.tar.gz cgeo-20bcca86fd5cbe8a38debd8ecee7f848d57e8426.tar.bz2 | |
add final qualifier to vars
| -rw-r--r-- | main/src/cgeo/geocaching/ImageSelectActivity.java | 13 |
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; } |
