如何以高质量更改 google 服务帐户个人资料图片?

How to change google service account profile picture in high quality?

我正在使用并且工作正常,问题是它将图像缩小到 96 X 96。如果我从 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 的目录 API 文档:

Whatever the size of the photo being uploaded, the API downsizes it to 96x96 pixels.

所以这符合预期。

参考文献: