我正在开发离子2应用程序。我正在尝试获得高质量的图像,然后将其调整为头像照片。
我的代码:
_FBUserProfile() {
return new Promise((resolve, reject) => {
Facebook.api('me?fields=id,name,email,first_name,last_name,picture.width(600).height(600).as(picture_small),picture.width(360).height(360).as(picture_large)', [])
.then((profileData) => {
console.log(JSON.stringify(profileData));
return resolve(profileData);
}, (err) => {
console.log(JSON.stringify(err));
return reject(err);
});
});
}
但是,照片质量不好,因为我觉得我在这行调整大小时出了问题:
picture.width(600).height(600).as(picture_small),picture.width(360).height(360).as(picture_large)', [])
如何才能获得高质量的照片?