【发布时间】:2016-07-31 17:21:16
【问题描述】:
我正在尝试使用 Google gdata 照片 API 将图像和视频从我的 Olympus 相机上传到 Google 照片。 当我指定 contentType='image/jpeg' 时,它会精美地上传到 Google 照片。
但是,我无法上传 .ORF 和 .MTS 文件。代码摘录如下:
gd_client = gdata.photos.service.PhotosService(source=user_agent,
email=email,
additional_headers={'Authorization' : 'Bearer %s' % credentials.access_token})
album = gd_client.InsertAlbum( title=d, summary=d, access='private')
gd_client.InsertPhoto(album, picasa_photo, localPath, content_type=contentType)
例如,当我将 contentType 更改为 'image/x-olympus-orf' 时,上传失败。错误是:
(400, 'Bad Request', 'Not a valid image.')
基于API doc,content_type 参数是可选的。我尝试将其删除,但这也无济于事。 MTS 视频文件的结果相同。
【问题讨论】: