Skip to content

Commit 185582c

Browse files
committed
Photo viewer now uses low quality for the lo-res image
1 parent 6023822 commit 185582c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ public static String fixAvatar(final String imageUrl, int avatarSz) {
2020
return "";
2121

2222
// if this isn't a gravatar image, return as resized photon image url
23-
if (!imageUrl.contains("gravatar.com"))
23+
if (!imageUrl.contains("gravatar.com")) {
2424
return getPhotonImageUrl(imageUrl, avatarSz, avatarSz);
25+
}
2526

2627
// remove all other params, then add query string for size and "mystery man" default
2728
return UrlUtils.removeQuery(imageUrl) + "?s=" + avatarSz + "&d=mm";
@@ -35,12 +36,13 @@ public static boolean isMshotsUrl(final String imageUrl) {
3536
}
3637

3738
/*
38-
* returns a photon url for the passed image with the resize query set to the passed dimensions
39+
* returns a photon url for the passed image with the resize query set to the passed
40+
* dimensions - note that the passed quality parameter will only affect JPEGs
3941
*/
4042
public static enum Quality {
4143
HIGH,
4244
MEDIUM,
43-
LOW,
45+
LOW
4446
}
4547
public static String getPhotonImageUrl(String imageUrl, int width, int height) {
4648
return getPhotonImageUrl(imageUrl, width, height, Quality.MEDIUM);
@@ -85,7 +87,7 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
8587
}
8688

8789
// if both width & height are passed use the "resize" param, use only "w" or "h" if just
88-
// one of them is set - note that the passed quality parameter will only affect JPEGs
90+
// one of them is set
8991
final String query;
9092
if (width > 0 && height > 0) {
9193
query = "?resize=" + width + "," + height + "&" + qualityParam;

0 commit comments

Comments
 (0)