内容纲要
500px.com 的图片有多种尺寸,在图片接口 https://api.500px.com/v1/photos 有个参数是 image_size[],意思是想要获取什么尺寸的图片,其取值如下
image_size[]=1
image_size[]=2
image_size[]=4
image_size[]=14
image_size[]=31
image_size[]=32
image_size[]=33
image_size[]=34
image_size[]=35
image_size[]=36
image_size[]=2048
image_size[]=4096
经过验证,4096 是最大分辨率,那么其他 size 都表示什么含义呢?经过初步研究,大约有了以下结论
- 可以尝试未公开的 size,例如 是 3,5,30,4096
- 各 size 返回的图片如下表
| size | 形状 | width | height | 说明 |
|---|---|---|---|---|
| 1 | square | 70 | 70 | 截取 |
| 2 | square | 140 | 140 | 截取 |
| 3 | square | 280 | 280 | 截取 |
| 4 | rect | <= 900 | <= 900 | max(width, height) = 900,缩放 |
| 5 | rect | <= 1170 | <= 1170 | max(width, height) = 1170,缩放 |
| 14 | rect | <= 900 | <= 900 | max(width, height) = 900,缩放 |
| 30 | rect | <=256 | <=256 | max(width, height) = 256,缩放 |
| 31 | rect | * | 450 | 缩放 |
| 32 | rect | * | 300 | 缩放 |
| 33 | rect | * | 600 | 缩放 |
| 34 | rect | <= 1000 | <= 1000 | max(width, height) = 1000,缩放 |
| 35 | rect | <= 1500 | <= 1500 | max(width, height) = 1500,缩放 |
| 36 | rect | <= 2000 | <= 2000 | max(width, height) = 2000,缩放 |
| 2048 | rect | <= 2048 | <= 2048 | max(width, height) = 2048,缩放 |
| 4096 | rect | <= 4096 | <= 4096 | max(width, height) = 4096,缩放 |
这些尺寸里,最有价值的大概是 3, 31, 32, 2048, 4096
演示一下
size = 1: 70 * 70

size = 2: 140 * 140

size = 3: 280 * 280

size = 4: max(width, height) = 900

size = 14

size = 31: height = 450

size = 32: height = 300

size = 33: height = 600

500px 系列五:图片尺寸研究
