質問

次のPythonコードを使用してGoogleドライブからファイルを取得しています。

theGoogleDriveFile = service.files().get(fileId=<googleDriveFileId>).execute()
.

このファイルのサイズ変更についてどのようにして画像があるのですか?私は以下を試しました:

resizedImage = images.resize(theGoogleDriveFile['downloadUrl'], 32, 32)
.

しかし、次のエラーが発生します:

raise NotImageError()
NotImageError
.

役に立ちましたか?

解決

これは機能します:

theGoogleDriveFile = service.files().get(fileId=<googleDriveFileId>).execute()
result = urlfetch.fetch(theGoogleDriveFile['webContentLink'])                
resizedImage = images.resize(result.content, 32, 32)
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top