diff options
4 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/data/LocalImage.java b/src/com/android/gallery3d/data/LocalImage.java index 370ef2686..b10b96289 100644 --- a/src/com/android/gallery3d/data/LocalImage.java +++ b/src/com/android/gallery3d/data/LocalImage.java @@ -309,7 +309,11 @@ public class LocalImage extends LocalMediaItem { public MediaDetails getDetails() { MediaDetails details = super.getDetails(); details.addDetail(MediaDetails.INDEX_ORIENTATION, Integer.valueOf(rotation)); - MediaDetails.extractExifInfo(details, filePath); + if (MIME_TYPE_JPEG.equals(mimeType)) { + // ExifInterface returns incorrect values for photos in other format. + // For example, the width and height of an webp images is always '0'. + MediaDetails.extractExifInfo(details, filePath); + } return details; } diff --git a/src/com/android/gallery3d/data/LocalMediaItem.java b/src/com/android/gallery3d/data/LocalMediaItem.java index fdc973e8d..eb054d03e 100644 --- a/src/com/android/gallery3d/data/LocalMediaItem.java +++ b/src/com/android/gallery3d/data/LocalMediaItem.java @@ -86,6 +86,8 @@ public abstract class LocalMediaItem extends MediaItem { details.addDetail(MediaDetails.INDEX_TITLE, caption); DateFormat formater = DateFormat.getDateTimeInstance(); details.addDetail(MediaDetails.INDEX_DATETIME, formater.format(new Date(dateTakenInMs))); + details.addDetail(MediaDetails.INDEX_WIDTH, width); + details.addDetail(MediaDetails.INDEX_HEIGHT, height); if (GalleryUtils.isValidLocation(latitude, longitude)) { details.addDetail(MediaDetails.INDEX_LOCATION, new double[] {latitude, longitude}); diff --git a/src/com/android/gallery3d/ui/PopupList.java b/src/com/android/gallery3d/ui/PopupList.java index ee02029c7..a5fbb09a8 100644 --- a/src/com/android/gallery3d/ui/PopupList.java +++ b/src/com/android/gallery3d/ui/PopupList.java @@ -18,7 +18,6 @@ import android.widget.PopupWindow; import android.widget.TextView; import com.android.gallery3d.R; -import com.android.gallery3d.common.Utils; import java.util.ArrayList; @@ -86,7 +85,6 @@ public class PopupList { new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - Utils.debug("onItemClick: %s, %s", position, id); if (mPopupWindow == null) return; mPopupWindow.dismiss(); if (mOnPopupItemClickListener != null) { diff --git a/src/com/android/gallery3d/util/MotionEventHelper.java b/src/com/android/gallery3d/util/MotionEventHelper.java index 1c9d06244..715f7fa69 100644 --- a/src/com/android/gallery3d/util/MotionEventHelper.java +++ b/src/com/android/gallery3d/util/MotionEventHelper.java @@ -38,8 +38,9 @@ public final class MotionEventHelper { @TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB) private static MotionEvent transformEventNew(MotionEvent e, Matrix m) { - e.transform(m); - return e; + MotionEvent newEvent = MotionEvent.obtain(e); + newEvent.transform(m); + return newEvent; } // This is copied from Input.cpp in the android framework. |