U
U
user0name02018-08-21 15:11:29
PHP
user0name0, 2018-08-21 15:11:29

How to get maximum image size in vk api via wall.get?

I get information about the post via wall.get, the output of photo permissions from this post looks like this:

spoiler
"photo": {
"id": ****,
"album_id": -7,
"owner_id": -****,
"user_id": ****,
"sizes": [{
"type": "m",
"url": "https://pp.userap...2ca/WFWHBKIsJc4.jpg",
"width": 130,
"height": 125
}, {
"type": "o",
"url": "https://pp.userap...2ce/eSVE4kl5yqg.jpg",
"width": 130,
"height": 125
}, {
"type": "p",
"url": "https://pp.userap...2cf/zPwkqbdRkEI.jpg",
"width": 200,
"height": 192
}, {
"type": "q",
"url": "https://pp.userap...2d0/Ni2mXCifANY.jpg",
"width": 320,
"height": 307
}, {
"type": "r",
"url": "https://pp.userap...2d1/eocR5ckPd5w.jpg",
"width": 510,
"height": 490
}, {
"type": "s",
"url": "https://pp.userap...2c9/ivqERmnW5NI.jpg",
"width": 75,
"height": 72
}, {
"type": "x",
"url": "https://pp.userap...2cb/WdYHzNRZrK0.jpg",
"width": 604,
"height": 580
}, {
"type": "y",
"url": "https://pp.userap...2cc/EvboDkwfw7g.jpg",
"width": 807,
"height": 775
}, {
"type": "z",
"url": "https://pp.userap...2cd/pzIS6mZAW8M.jpg",
"width": 1080,
"height": 1037
}],


And the original image is output under different numbers and different types every time. Here it is type z and 8 serial number, in another post - 6 number and another type. How to get max size?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
user0name0, 2018-08-21
@user0name0

https://vk.com/dev/objects/photo_sizes
It says here that:
y is a proportional copy of the image with a maximum side of 807px;
z - proportional copy of the image with a maximum size of 1080x1024;
w is a proportional copy of the image with a maximum size of 2560x2048px.
Probably need to iterate over types, is there w, z or y in order? How to implement it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question