Class: DropboxApi::Endpoints::Files::GetThumbnail

Inherits:
ContentDownload show all
Includes:
OptionsValidator
Defined in:
lib/dropbox_api/endpoints/files/get_thumbnail.rb

Constant Summary collapse

Method =
:post
Path =
"/2/files/get_thumbnail".freeze
ResultType =
DropboxApi::Metadata::File
ErrorType =
DropboxApi::Errors::PreviewError

Instance Method Summary collapse

Methods included from OptionsValidator

#validate_options

Methods inherited from ContentDownload

#build_request, #initialize, #perform_request

Methods inherited from Base

add_endpoint

Constructor Details

This class inherits a constructor from DropboxApi::Endpoints::ContentDownload

Instance Method Details

#get_thumbnail(path, options = {}) ⇒ Object

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.

Parameters:

  • path (String)

    The path to the image file you want to thumbnail.



24
25
26
27
28
29
30
31
32
# File 'lib/dropbox_api/endpoints/files/get_thumbnail.rb', line 24

add_endpoint :get_thumbnail do |path, options = {}, &block|
  validate_options([:format, :size], options)
  options[:format] ||= :jpeg
  options[:size] ||= :w64h64

  perform_request(options.merge({
    :path => path
  }), &block)
end