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: 

SwiftyDropbox getting image/video thumbnail

SwiftyDropbox getting image/video thumbnail

alyoka
New member | Level 2
Go to solution

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

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

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

alyoka
New member | Level 2
Go to solution
Thank you!
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    alyoka New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?