Skip to content

Commit 47d1e59

Browse files
committed
Revert "Fixes issue where private blog images wouldn't load."
This reverts commit c37fd90.
1 parent d632cb7 commit 47d1e59

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,6 @@ public static boolean isImageUrl(String url) {
231231
cleanedUrl.endsWith("gif") || cleanedUrl.endsWith("png");
232232
}
233233

234-
/**
235-
* Returns true if the url is on wordpress.com
236-
*/
237-
public static boolean isWPComUrl(String url) {
238-
return !TextUtils.isEmpty(url) && url.contains("wordpress.com");
239-
}
240-
241-
242234
public static String appendUrlParameter(String url, String paramName, String paramValue) {
243235
Map<String, String> parameters = new HashMap<>();
244236
parameters.put(paramName, paramValue);

WordPressUtils/src/main/java/org/wordpress/android/util/helpers/WPImageGetter.java

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import android.graphics.Canvas;
44
import android.graphics.drawable.BitmapDrawable;
55
import android.graphics.drawable.Drawable;
6-
import android.support.v4.util.ArrayMap;
76
import android.text.Html;
87
import android.text.TextUtils;
98
import android.widget.TextView;
@@ -14,18 +13,14 @@
1413
import org.wordpress.android.util.AppLog;
1514
import org.wordpress.android.util.AppLog.T;
1615
import org.wordpress.android.util.PhotonUtils;
17-
import org.wordpress.android.util.UrlUtils;
1816

1917
import java.lang.ref.WeakReference;
20-
import java.util.Map;
2118

2219
/**
2320
* ImageGetter for Html.fromHtml()
2421
* adapted from existing ImageGetter code in NoteCommentFragment
2522
*/
2623
public class WPImageGetter implements Html.ImageGetter {
27-
private static final String IMAGE_QUALITY = "65";
28-
2924
private final WeakReference<TextView> mWeakView;
3025
private final int mMaxSize;
3126
private ImageLoader mImageLoader;
@@ -37,13 +32,13 @@ public WPImageGetter(TextView view) {
3732
}
3833

3934
public WPImageGetter(TextView view, int maxSize) {
40-
mWeakView = new WeakReference<>(view);
35+
mWeakView = new WeakReference<TextView>(view);
4136
mMaxSize = maxSize;
4237
}
4338

4439
public WPImageGetter(TextView view, int maxSize, ImageLoader imageLoader, Drawable loadingDrawable,
4540
Drawable failedDrawable) {
46-
mWeakView = new WeakReference<>(view);
41+
mWeakView = new WeakReference<TextView>(view);
4742
mMaxSize = maxSize;
4843
mImageLoader = imageLoader;
4944
mLoadingDrawable = loadingDrawable;
@@ -69,20 +64,10 @@ public Drawable getDrawable(String source) {
6964
source = "http:" + source;
7065
}
7166

72-
// Resize to max size if requested (otherwise the full-sized image will be downloaded
67+
// use Photon if a max size is requested (otherwise the full-sized image will be downloaded
7368
// and then resized)
7469
if (mMaxSize > 0) {
75-
if (UrlUtils.isWPComUrl(source)) {
76-
// Adjust query params for wp.com urls
77-
Map<String, String> params = new ArrayMap<>();
78-
params.put("w", String.valueOf(mMaxSize));
79-
params.put("quality", IMAGE_QUALITY);
80-
81-
source = UrlUtils.appendUrlParameters(UrlUtils.removeQuery(source), params);
82-
} else {
83-
// Otherwise use photon
84-
source = PhotonUtils.getPhotonImageUrl(source, mMaxSize, 0);
85-
}
70+
source = PhotonUtils.getPhotonImageUrl(source, mMaxSize, 0);
8671
}
8772

8873
final RemoteDrawable remote = new RemoteDrawable(mLoadingDrawable, mFailedDrawable);

0 commit comments

Comments
 (0)