Class | Paperclip::Thumbnail |
In: |
lib/paperclip/thumbnail.rb
|
Parent: | Processor |
Handles thumbnailing images that are uploaded.
ANIMATED_FORMATS | = | %w(gif) | List of formats that we need to preserve animation |
animated | [RW] | |
convert_options | [RW] | |
current_geometry | [RW] | |
format | [RW] | |
source_file_options | [RW] | |
target_geometry | [RW] | |
whiny | [RW] |
Creates a Thumbnail object set to work on the file given. It will attempt to transform the image into one defined by target_geometry which is a "WxH"-style string. format will be inferred from the file unless specified. Thumbnail creation will raise no errors unless whiny is true (which it is, by default. If convert_options is set, the options will be appended to the convert command upon image conversion
Options include:
+geometry+ - the desired width and height of the thumbnail (required) +file_geometry_parser+ - an object with a method named +from_file+ that takes an image file and produces its geometry and a +transformation_to+. Defaults to Paperclip::Geometry +string_geometry_parser+ - an object with a method named +parse+ that takes a string and produces an object with +width+, +height+, and +to_s+ accessors. Defaults to Paperclip::Geometry +source_file_options+ - flags passed to the +convert+ command that influence how the source file is read +convert_options+ - flags passed to the +convert+ command that influence how the image is processed +whiny+ - whether to raise an error when processing fails. Defaults to true +format+ - the desired filename extension +animated+ - whether to merge all the layers in the image. Defaults to true