summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ImageManager.java
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-18 17:39:48 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-18 17:39:48 -0700
commitde365d87520c97d6b1636442e6b5c82a3e036f29 (patch)
treeab6ea60037b29e6498aa4e29dbfe92b4d014c3f7 /src/com/android/camera/ImageManager.java
parent8d0dd0e2ee9a9f8d729ed96597102777cf14701f (diff)
downloadpackages_apps_LegacyCamera-de365d87520c97d6b1636442e6b5c82a3e036f29.zip
packages_apps_LegacyCamera-de365d87520c97d6b1636442e6b5c82a3e036f29.tar.gz
packages_apps_LegacyCamera-de365d87520c97d6b1636442e6b5c82a3e036f29.tar.bz2
auto import from //branches/cupcake_rel/...@140373
Diffstat (limited to 'src/com/android/camera/ImageManager.java')
-rwxr-xr-xsrc/com/android/camera/ImageManager.java24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java
index 0b5c850..d7cfc2b 100755
--- a/src/com/android/camera/ImageManager.java
+++ b/src/com/android/camera/ImageManager.java
@@ -2108,13 +2108,7 @@ public class ImageManager {
}
if (bitmap != null) {
- int degrees = getDegreesRotated();
- if (degrees != 0) {
- Matrix m = new Matrix();
- m.setRotate(degrees, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2);
- bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(),
- m, true);
- }
+ bitmap = rotate(bitmap, getDegreesRotated());
}
long elapsed = System.currentTimeMillis();
@@ -2328,15 +2322,6 @@ public class ImageManager {
if (pfd == null)
return null;
- try {
- InputStream is = mContentResolver.openInputStream(uri);
- Log.v(TAG, "available = " + is.available());
- if (is.available() > 5*1024*1024) return null;
- is.close();
- } catch (IOException ex) {
- return null;
- }
-
if (options == null)
options = new BitmapFactory.Options();
@@ -3698,6 +3683,11 @@ public class ImageManager {
* @return
*/
static public Bitmap extractMiniThumb(Bitmap source, int width, int height) {
+ return extractMiniThumb(source, width, height, true);
+ }
+
+ static public Bitmap extractMiniThumb(Bitmap source, int width, int height,
+ boolean recycle) {
if (source == null) {
return null;
}
@@ -3713,7 +3703,7 @@ public class ImageManager {
Bitmap miniThumbnail = ImageLoader.transform(matrix, source,
width, height, false);
- if (miniThumbnail != source) {
+ if (recycle && miniThumbnail != source) {
source.recycle();
}
return miniThumbnail;