Sha256: 9c128f2f6abcfbceb85c45da30558e3cf3756d0e39e846f7daf8056492ac4bb6
Contents?: true
Size: 1.09 KB
Versions: 11
Compression:
Stored size: 1.09 KB
Contents
require 'RMagick' module Dragonfly module Encoding class RMagickEncoder include Configurable include RMagickUtils configurable_attr :supported_formats, [ :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 ] configurable_attr :use_filesystem, true def encode(temp_object, format, encoding={}) format = format.to_s.downcase throw :unable_to_handle unless supported_formats.include?(format.to_sym) rmagick_image(temp_object) do |image| if image.format.downcase == format temp_object # do nothing else image.format = format image end end end end end end
Version data entries
11 entries across 11 versions & 2 rubygems