Created
September 29, 2015 13:41
-
-
Save brucetoo/492926313ae822e4e503 to your computer and use it in GitHub Desktop.
Get a thumbnail image url from original url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * get a thumbnail image url from original url | |
| * @param imgUrl original image url | |
| * @param width width u need | |
| * @param height height u need | |
| * @return the number(85) in below url indicate the quality of original image | |
| */ | |
| public static String getThumbnailImageUrl(String imgUrl,int width,int height){ | |
| String url="http://imgsize.ph.126.net/?imgurl=data1_data2xdata3x0x85.jpg&enlarge=true"; | |
| url=url.replaceAll("data1", imgUrl).replaceAll("data2", width+"").replaceAll("data3", height+""); | |
| return url; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment