Skip to content

Commit

Permalink
Revert "Revert "Merge pull request #1799 from wordpress-mobile/featur…
Browse files Browse the repository at this point in the history
…e/1795-reader-render-attachments""

This reverts commit 6936da1.

Conflicts:
	WordPress/src/main/java/org/wordpress/android/datasets/ReaderDatabase.java
  • Loading branch information
maxme committed Sep 8, 2014
1 parent 470f5c8 commit 5fca796
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static String fixAvatar(final String imageUrl, int avatarSz) {
return getPhotonImageUrl(imageUrl, avatarSz, avatarSz);

// remove all other params, then add query string for size and "mystery man" default
return UrlUtils.removeQuery(imageUrl) + String.format("?s=%d&d=mm", avatarSz);
return UrlUtils.removeQuery(imageUrl) + "?s=" + avatarSz + "&d=mm";
}

/*
Expand Down Expand Up @@ -64,18 +64,18 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height) {
// see http://wp.tutsplus.com/tutorials/how-to-generate-website-screenshots-for-your-wordpress-site/
// ex: http://s.wordpress.com/mshots/v1/http%3A%2F%2Fnickbradbury.com?w=600
if (isMshotsUrl(imageUrl)) {
return imageUrl + String.format("?w=%d&h=%d", width, height);
return imageUrl + "?w=" + width + "&h=" + height;
}

// if both width & height are passed use the "resize" param, use only "w" or "h" if just
// one of them is set, otherwise no query string
final String query;
if (width > 0 && height > 0) {
query = String.format("?resize=%d,%d", width, height);
query = "?resize=" + width + "," + height;
} else if (width > 0) {
query = String.format("?w=%d", width);
query = "?w=" + width;
} else if (height > 0) {
query = String.format("?h=%d", height);
query = "?h=" + height;
} else {
query = "";
}
Expand Down

0 comments on commit 5fca796

Please sign in to comment.