简体   繁体   English

Vkontakte:使用passport.js获取大头像

[英]Vkontakte: get big profile image with passport.js

In passport.js, I retrieve vkontakte profile picture like this: 在passport.js中,我检索vkontakte个人资料图片,如下所示:

newUser.vkontakte.image = profile.photos[0].value;

This gives me the smallest picture size. 这给了我最小的图片尺寸。 How can I get the original size? 如何获得原始尺寸?

I did try things like 我确实尝试过

newUser.vkontakte.image = profile.photo_200;

or 要么

newUser.vkontakte.image = params.photo_200;

but response was empty. 但是回应是空的。 Just in case, I changed scope like this: 以防万一,我更改了范围,如下所示:

'friends, photos, email, photo_200'

When I get profile photo url like this 当我收到这样的个人资料照片网址时

http://pbs.tw........32735322/afY8luRq_normal.jpeg . http://pbs.tw........32735322/afY8luRq_normal.jpeg

I substring "_normal". 我子串“ _normal”。 It's will get original image size 它将获得原始图像大小

http://pbs.tw........32735322/afY8luRq.jpeg . http://pbs.tw........32735322/afY8luRq.jpeg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM