4

我想获取单个 flickr 图像的所有图像大小的列表,并且我需要能够获取调整大小的图像的 url,全部为 json 格式。

我想得到这样的东西

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

如何构造网址?我在任何地方都找不到任何可理解的指南!!!!

这是一个响应式图像脚本顺便说一句

4

2 回答 2

4

尝试:

flickr.photos.getSizes

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

返回照片的可用尺寸。主叫用户必须有权查看照片。验证

此方法不需要身份验证。

论据

api_key(必需)您的 API 应用程序密钥。有关更多详细信息,请参见此处。

photo_id (必需)要为其获取尺寸信息的照片的 ID。

示例响应

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

你知道任何可以从 Flickr @william malo 收集原始尺寸图像的方法或源代码吗?

于 2014-07-09T09:19:56.740 回答