Retrieving profile image from Google+ API

前端 未结 3 1464
滥情空心
滥情空心 2020-12-17 16:46

I am trying to pull JSON data from Google+ API. When I include the image attribute size of the image is set to 50px. How do I change the image size? I don\'t see it on the

3条回答
  •  死守一世寂寞
    2020-12-17 17:45

    Because there is no way in the api to do this, you can just use sustr to remove the ?str= and add your own:

    $imageUrl = substr($user['image']['url'],0,strpos($user['image']['url']."?sz=","?sz=")) . '?sz=100';
    

    Or for javascript:

    iamgeUrl=user[image][url].substr(0,user[image][url].indexOf('?str=')) + '?sz=100';
    

提交回复
热议问题