最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - get all image sizes flickr api - Stack Overflow

programmeradmin2浏览0评论

I want to get a list of all image sizes for a single flickr image and I need to be able to get the url of the resized images, all in json format.

I would like to get something like this

[
 {width:200,height:200,url:".jpg"}
,{width:400,height:400,url:".jpg"}
,{width:600,height:600,url:".jpg"}
,{width:800,height:800,url:".jpg"}
]

How do I construct the url? I can't find any prehensible guide anywhere!!!!

This is for a responsive image script btw

I want to get a list of all image sizes for a single flickr image and I need to be able to get the url of the resized images, all in json format.

I would like to get something like this

[
 {width:200,height:200,url:"http://flickr./200ximage.jpg"}
,{width:400,height:400,url:"http://flickr./400ximage.jpg"}
,{width:600,height:600,url:"http://flickr./600ximage.jpg"}
,{width:800,height:800,url:"http://flickr./800ximage.jpg"}
]

How do I construct the url? I can't find any prehensible guide anywhere!!!!

This is for a responsive image script btw

Share Improve this question asked Nov 18, 2012 at 19:47 william malowilliam malo 2,5062 gold badges19 silver badges18 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Try:

flickr.photos.getSizes

http://www.flickr./services/api/flickr.photos.getSizes.html

Returns the available sizes for a photo. The calling user must have permission to view the photo. Authentication

This method does not require authentication.

Arguments

api_key (Required) Your API application key. See here for more details.

photo_id (Required) The id of the photo to fetch size information for.

Example Response

<sizes canblog="1" canprint="1" candownload="1">
  <size label="Square" width="75" height="75" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_s.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/sq/" media="photo" />
  <size label="Large Square" width="150" height="150" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_q.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/q/" media="photo" />
  <size label="Thumbnail" width="100" height="75" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_t.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/t/" media="photo" />
  <size label="Small" width="240" height="180" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_m.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/s/" media="photo" />
  <size label="Small 320" width="320" height="240" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_n.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/n/" media="photo" />
  <size label="Medium" width="500" height="375" source="http://farm2.staticflickr./1103/567229075_2cf8456f01.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/m/" media="photo" />
  <size label="Medium 640" width="640" height="480" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_z.jpg?zz=1" url="http://www.flickr./photos/stewart/567229075/sizes/z/" media="photo" />
  <size label="Medium 800" width="800" height="600" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_c.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/c/" media="photo" />
  <size label="Large" width="1024" height="768" source="http://farm2.staticflickr./1103/567229075_2cf8456f01_b.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/l/" media="photo" />
  <size label="Original" width="2400" height="1800" source="http://farm2.staticflickr./1103/567229075_6dc09dc6da_o.jpg" url="http://www.flickr./photos/stewart/567229075/sizes/o/" media="photo" />
</sizes>

Do you know of any ways or source code that can gather original sized images from Flickr @william malo?

发布评论

评论列表(0)

  1. 暂无评论