Skip to content

Commit

Permalink
Allow photon to resize GIFs
Browse files Browse the repository at this point in the history
  • Loading branch information
nbradbury committed Dec 13, 2015
1 parent 4d1d85e commit f413bfd
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static boolean isMshotsUrl(final String imageUrl) {
* returns a photon url for the passed image with the resize query set to the passed
* dimensions - note that the passed quality parameter will only affect JPEGs
*/
public static enum Quality {
public enum Quality {
HIGH,
MEDIUM,
LOW
Expand All @@ -45,13 +45,6 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
// remove existing query string since it may contain params that conflict with the passed ones
imageUrl = UrlUtils.removeQuery(imageUrl);

// don't use with GIFs - photon breaks animated GIFs, and sometimes returns a GIF that
// can't be read by BitmapFactory.decodeByteArray (used by Volley in ImageRequest.java
// to decode the downloaded image)
if (imageUrl.endsWith(".gif")) {
return imageUrl;
}

// if this is an "mshots" url, skip photon and return it with a query that sets the width/height
if (isMshotsUrl(imageUrl)) {
return imageUrl + "?w=" + width + "&h=" + height;
Expand Down

0 comments on commit f413bfd

Please sign in to comment.