Skip to content

Commit f413bfd

Browse files
committed
Allow photon to resize GIFs
1 parent 4d1d85e commit f413bfd

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static boolean isMshotsUrl(final String imageUrl) {
2323
* returns a photon url for the passed image with the resize query set to the passed
2424
* dimensions - note that the passed quality parameter will only affect JPEGs
2525
*/
26-
public static enum Quality {
26+
public enum Quality {
2727
HIGH,
2828
MEDIUM,
2929
LOW
@@ -45,13 +45,6 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
4545
// remove existing query string since it may contain params that conflict with the passed ones
4646
imageUrl = UrlUtils.removeQuery(imageUrl);
4747

48-
// don't use with GIFs - photon breaks animated GIFs, and sometimes returns a GIF that
49-
// can't be read by BitmapFactory.decodeByteArray (used by Volley in ImageRequest.java
50-
// to decode the downloaded image)
51-
if (imageUrl.endsWith(".gif")) {
52-
return imageUrl;
53-
}
54-
5548
// if this is an "mshots" url, skip photon and return it with a query that sets the width/height
5649
if (isMshotsUrl(imageUrl)) {
5750
return imageUrl + "?w=" + width + "&h=" + height;

0 commit comments

Comments
 (0)