Class: IiifS3::Thumbnail
- Inherits:
-
ImageVariant
- Object
- ImageVariant
- IiifS3::Thumbnail
- Defined in:
- lib/iiif_s3/thumbnail.rb
Overview
Class Thumbnail provides a specific variant of an image file used for the thumbnail links within the metadata. It will generate a consistent sized version based on a max width and height. By default, it generates images at 250px on the longest size.
Instance Attribute Summary
Attributes inherited from ImageVariant
Instance Method Summary collapse
-
#initialize(data, config, max_width = nil, max_height = nil) ⇒ Thumbnail
constructor
Initialize a new thumbnail.
Methods inherited from ImageVariant
#generate_image_id, #height, #mime_type, #width
Methods included from Utilities::Helpers
#add_default_redirect, #add_file_to_s3, #generate_build_location, #generate_id, #generate_image_location, #get_data_path, #get_s3_key, #save_to_disk
Constructor Details
#initialize(data, config, max_width = nil, max_height = nil) ⇒ Thumbnail
Initialize a new thumbnail.
22 23 24 25 26 |
# File 'lib/iiif_s3/thumbnail.rb', line 22 def initialize(data, config, max_width=nil, max_height = nil) @max_width = max_width || config.thumbnail_size @max_height = max_height || config.thumbnail_size super(data,config) end |