为Google驱动器设置缩略图图像 [英] Setting a thumbnail image for Google drive

查看:91
本文介绍了为Google驱动器设置缩略图图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图为Google驱动器文件(包含对外部外部应用程序对象的引用)设置缩略图:

I am trying to set a thumbnail image for a Google drive file (containing a reference to an external external application object):

data={"thumbnail": {
        "mimeType":"image/png",
        "image":base64.urlsafe_b64encode(image)
        }
    }

headers={
    "Authorization": "Bearer "+accessToken,
    "Content-Type": "application/json"
    }

rsp=requests.patch("https://www.googleapis.com/drive/v2/files/"+id,data=json.dumps(data), timeout=15, headers=headers)

请求成功(200),但云端硬盘用户界面不显示预览。

The requests succeeds (200), but the Drive UI does not display the preview.

当我尝试从文件资源中加载thumbnailLink时,会报告404状态。

When I try to load the thumbnailLink from file resource, a 404 status is reported.

推荐答案

是缩略图大小。它太小(100px * 70px)。

The problem was the thumbnail size. It was too small (100px*70px).

文档指出缩略图为220px或更大。

The docs says, that the thumbnail should be 220px or bigger.

正确的描述应该是:缩略图必须为220px或更大

The correct description should be: The thumbnail must be 220px or bigger

这篇关于为Google驱动器设置缩略图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆