Reputation: 2964
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)
The requests succeeds (200), but the Drive UI does not display the preview.
When I try to load the thumbnailLink from file resource, a 404 status is reported.
Upvotes: 0
Views: 794
Reputation: 2964
The problem was the thumbnail size. It was too small (100px*70px).
The docs says, that the thumbnail should be 220px or bigger.
The correct description should be: The thumbnail must be 220px or bigger
Upvotes: 1