Class: Pageflow::LinkmapPage::PaperclipProcessors::ColorMask
- Inherits:
-
Paperclip::Processor
- Object
- Paperclip::Processor
- Pageflow::LinkmapPage::PaperclipProcessors::ColorMask
- Defined in:
- lib/pageflow/linkmap_page/paperclip_processors/color_mask.rb
Constant Summary collapse
- CONVERT_COMMAND =
[ # Create mask by making all non-matching colors in color map # image transparent ':color_map', '+transparent :color', # Make all areas transparent in source that are transparent in mask ':source', '-compose src-in -composite', # Write result to output file ':dest' ].join(' ').freeze
Instance Method Summary collapse
Instance Method Details
#make ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pageflow/linkmap_page/paperclip_processors/color_mask.rb', line 17 def make with_destination_tempfile do |dest| with_color_map do |color_map_path| convert(CONVERT_COMMAND, color: "##{[:style]}", color_map: color_map_path, source: File.(file.path), dest: File.(dest.path)) end end end |