Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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? Is there a Swift counterpart for Android's getThumbnailBuilder?
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
}
}
}
The files.getThumbnail method in the SwityDropbox SDK is the equivalent method for getting thumbnails as getThumbnailBuilder in the Android/Java SDK.
Anyway, yes, errors from the getThumbnail call should be captured by the error code block. Can you share whatever output/crash you're getting? Also, the parameters you're using may be helpful.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!