[我正在使用,并且工作正常,问题在于它会将图像缩小到96 X96。如果我从Google信息中心上传相同的图像,则会使图像裁剪,然后以良好的质量保存。
service.users.photos.update(
{
userKey: req.user.email,
auth: jwtClient,
requestBody: {
photoData: newfile,
width: '800',
height: '800',
kind: 'admin#directory#user#photo'
}
},
(err, response) => {
console.log(err);
console.log(response);
}
);
这正在按预期方式工作。
根据Users.photos: update
的Directory API文档:
无论上传的照片大小如何,API都会将其缩小为96x96像素。
所以这是预期的。