cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Video thumbnails

Video thumbnails

Petar N.
New member | Level 1

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 3

Greg-DB
Dropbox Staff

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.

sigrem
New 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-DB
Dropbox Staff

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!

Need more support?