Fix a bug in syncing with Picasaweb: the content_url should be different from screennail_url.
Now, the full size is set to the original size of a Picasaweb image;
the screennail is set to 512; and the thumbnail is set to 144 and cropped.
Change-Id: I138afa8a20bef6118f12c4ed4e88b5c6830ecc7e
diff --git a/new3d/src/com/android/gallery3d/picasa/PhotoEntry.java b/new3d/src/com/android/gallery3d/picasa/PhotoEntry.java
index f8e31ab..0f13baa 100644
--- a/new3d/src/com/android/gallery3d/picasa/PhotoEntry.java
+++ b/new3d/src/com/android/gallery3d/picasa/PhotoEntry.java
@@ -321,7 +321,7 @@
int height = Integer.parseInt(attrs.getValue("", "height"));
int dimension = Math.max(width, height);
String url = attrs.getValue("", "url");
- if (dimension <= 300) {
+ if (dimension <= PicasaApi.THUMBNAIL_SIZE_THRESHOLD) {
thumbnailUrl = url;
} else {
screennailUrl = url;
diff --git a/new3d/src/com/android/gallery3d/picasa/PicasaApi.java b/new3d/src/com/android/gallery3d/picasa/PicasaApi.java
index 011774e..b45d421 100644
--- a/new3d/src/com/android/gallery3d/picasa/PicasaApi.java
+++ b/new3d/src/com/android/gallery3d/picasa/PicasaApi.java
@@ -42,13 +42,20 @@
private static final String BASE_URL = "http://picasaweb.google.com/data/feed/api/";
private static final String BASE_QUERY_STRING;
+ // The specs of query parameters are documented here:
+ // http://code.google.com/apis/picasaweb/docs/2.0/reference.html
+ public static final int THUMBNAIL_SIZE_THRESHOLD = 144;
+ private static final String THUMBNAIL_SIZE = "144c";
+ private static final String SCREENNAIL_SIZE = "512u";
+ private static final String FULL_SIZE = "d"; // Use the original size
+
+
static {
// Build the base query string using screen dimensions.
- final StringBuilder query = new StringBuilder("?imgmax=1024&max-results=1000&thumbsize=");
- final String thumbnailSize = "144u,";
- final String screennailSize = "1024u";
- query.append(thumbnailSize);
- query.append(screennailSize);
+ final StringBuilder query = new StringBuilder("?max-results=1000");
+ query.append("&imgmax=").append(FULL_SIZE);
+ query.append("&thumbsize=").append(THUMBNAIL_SIZE).append(",")
+ .append(SCREENNAIL_SIZE);
query.append("&visibility=visible");
BASE_QUERY_STRING = query.toString();
}