How do I enlarge fb profile pic in Ionic without distorting it?

283 views Asked by At

After I get a user's fb profile pic from the login process. I want to be able to make it to fill the card. No matter what height and width I use, the pic is distorted unless I use it at a very small size. How do I know if my pic is a vector or a raster? I know that when you stretch raster images they distort. there a way to convert the pic into a vector image once I get it from the fb login results?

    <ion-item>
      <img src="{{event.hostPhoto}}" height="200" width="100">
    </ion-item>

</ion-card>
1

There are 1 answers

4
always_learning On

You can ask fb for the 200 * 150 sized image:

facebookConnectPlugin.api('/me?fields=id,picture.width(200).height(150)&access_token=' + authResponse.accessToken, null,
        function (response) {
          info.resolve(response);
        },
        function (response) {
        }
      );