Class: Dragonfly::ImageMagick::Encoder
- Inherits:
-
Object
- Object
- Dragonfly::ImageMagick::Encoder
- Includes:
- Configurable, Utils
- Defined in:
- lib/dragonfly/image_magick/encoder.rb
Instance Attribute Summary
Attributes included from Loggable
Configuration Summary
Configurable attributes
Configurable attributes for an object in generalobject
can be configured either by using something like
object.configure do |c| c.some_configurable_attribute = "some value" c.some_other_configurable_attribute = 42 ... endor
object.some_configurable_attribute = "some value"
Configurable attributes for instances of Dragonfly::ImageMagick::Encoder
-
supported_formats
- default[:ai, :bmp, :eps, :gif, :gif87, :ico, :j2c, :jp2, :jpeg, :jpg, :pbm, :pcd, :pct, :pcx, :pdf, :pict, :pjpeg, :png, :png24, :png32, :png8, :pnm, :ppm, :ps, :psd, :ras, :tga, :tiff, :wbmp, :xbm, :xpm, :xwd]
Instance Method Summary (collapse)
Methods included from Configurable
Methods included from Loggable
Methods included from Shell
#escape_args, #quote, #raise_shell_command_failed, #run
Instance Method Details
- (Object) encode(temp_object, format, args = '')
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/dragonfly/image_magick/encoder.rb', line 43 def encode(temp_object, format, args='') format = format.to_s.downcase throw :unable_to_handle unless supported_formats.include?(format.to_sym) details = identify(temp_object) if details[:format] == format.to_sym && args.empty? temp_object else convert(temp_object, args, format) end end |