Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Petar N.
10 years agoNew member | Level 1
Video thumbnails
Hi,
your documentation states the following for the get_thumbnail API:
"Get a thumbnail for an image.
This method currently supports files with the following file extensions: jpg, jpeg, png, tiff, tif, gif and bmp. Photos that are larger than 20MB in size won't be converted to a thumbnail."
We have tried using it for videos and it works fine, but we would like to be certain that we can rely on it, so we are wondering why videos aren't mentioned under the API description?
3 Replies
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
As you noticed, the actual thumbnail functionality in the API works with more file types than officially documented (like videos) as we've improved the back end over time. Right now, I only recommend relying on the officially documented formats working, so if you want to use this functionality for the unofficial types, please code with that in mind.
- sigrem9 years agoNew member | Level 1
Hi,
I use the following code to get thumbnail for images and videos (using Swifty Dropbox). It works for images and for many videos but crashes on some other videos. Shouldn't unsuccessful thumb generation be captured in the error section?
func fetchDropboxThumbnail(client: DropboxClient, file: Files.Metadata, toPath: String) {
let destination : (NSURL, NSHTTPURLResponse) -> NSURL = { temporaryURL, response in
let thumbUrl = NSURL(fileURLWithPath: toPath)
return thumbUrl
}
client.files.getThumbnail(path: file.pathLower, destination: destination).response { response, error in
if let response = response {
print("Assuming thumbnail saved to toPath")
}
else {
print("\(error)")
// Assuming thumbnail could not be generated
}
}
}
- Greg-DB9 years ago
Dropbox Community Moderator
sigrem, please open a new thread with the details of the issue you're having with SwiftyDropbox, including the details of whatever output/errors/crashes you're getting, so we can look into it. Thanks!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!