summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2012-10-31 17:21:02 -0700
committerSascha Haeberling <haeberling@google.com>2012-10-31 17:24:17 -0700
commit4f4c036e8537ab76301f7ad0faadf42a15538d7e (patch)
tree4ddebeb965720a8a7fcff7930d56ac7fc8a67224
parenta3c8cf04c31af4d53bb81d161241c13656847166 (diff)
downloadandroid_packages_apps_Snap-4f4c036e8537ab76301f7ad0faadf42a15538d7e.tar.gz
android_packages_apps_Snap-4f4c036e8537ab76301f7ad0faadf42a15538d7e.tar.bz2
android_packages_apps_Snap-4f4c036e8537ab76301f7ad0faadf42a15538d7e.zip
Fix tiny planet not using XMP metadata anymore
Bug: 7452777 Background: Semantics of isPanoramaSafe has changed and should not be called from within the TinyPlanet filter at all. Change-Id: I6bada525d30d9ff21fdff99f52c6697c3f828c7e
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java
index 61aa21b33..423e55828 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterTinyPlanet.java
@@ -80,10 +80,14 @@ public class ImageFilterTinyPlanet extends ImageFilter {
int w = bitmapIn.getWidth();
int h = bitmapIn.getHeight();
int outputSize = (int) (w / 2f);
-
ImagePreset preset = getImagePreset();
- if (preset != null && preset.isPanoramaSafe()) {
- bitmapIn = applyXmp(bitmapIn, preset, w);
+
+ if (preset != null) {
+ XMPMeta xmp = preset.getImageLoader().getXmpObject();
+ // Do nothing, just use bitmapIn as is if we don't have XMP.
+ if(xmp != null) {
+ bitmapIn = applyXmp(bitmapIn, xmp, w);
+ }
}
Bitmap mBitmapOut = Bitmap.createBitmap(
@@ -93,13 +97,8 @@ public class ImageFilterTinyPlanet extends ImageFilter {
return mBitmapOut;
}
- private Bitmap applyXmp(Bitmap bitmapIn, ImagePreset preset, int intermediateWidth) {
+ private Bitmap applyXmp(Bitmap bitmapIn, XMPMeta xmp, int intermediateWidth) {
try {
- XMPMeta xmp = preset.getImageLoader().getXmpObject();
- if (xmp == null) {
- // Do nothing, just use bitmapIn as is.
- return bitmapIn;
- }
int croppedAreaWidth =
getInt(xmp, CROPPED_AREA_IMAGE_WIDTH_PIXELS);
int croppedAreaHeight =