Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
alyoka
8 years agoNew member | Level 2
SwiftyDropbox getting image/video thumbnail
I'm trying to get a thumbnail but seem to receive the path to the original image/video. What am I doing wrong?
client.files.getThumbnail(path: file.pathLower).response{ response, error in
if let response = response, let thumbnailPath = response.0.pathLower {
print("Thumbnail: \(thumbnailPath), original: \(self.file.pathLower), size: \(response.0.size)")
}
}Prints (for a photo):
Thumbnail: /foto.jpg, original: /foto.jpg, size: 131816
Prints (for a video):
Thumbnail: /test/20170408_134934.mp4, original: /test/20170408_134934.mp4, size: 65015200
The files.getThumbnail call is a "download-style request", like files.download. The response.0 will be the original file metadata, so response.0.pathLower is the original file path. To get the data for the thumbnail, you should use response.1, like in the files.download example here:
https://github.com/dropbox/SwiftyDropbox#download-style-request
2 Replies
Replies have been turned off for this discussion
- Greg-DB8 years ago
Dropbox Community Moderator
The files.getThumbnail call is a "download-style request", like files.download. The response.0 will be the original file metadata, so response.0.pathLower is the original file path. To get the data for the thumbnail, you should use response.1, like in the files.download example here:
https://github.com/dropbox/SwiftyDropbox#download-style-request
- alyoka8 years agoNew member | Level 2Thank you!
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!