daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class VideoUploader < CommonUploader
  2.   include CarrierWave::Video  # for your video processing
  3.   include CarrierWave::Video::Thumbnailer
  4.  
  5.   version :preview do
  6.     process thumbnail: [{format: 'png', quality: 10, size: 192, strip: true, logger: Rails.logger}]
  7.     def full_filename for_file
  8.       png_name for_file, version_name
  9.     end
  10.   end
  11.  
  12.   def png_name for_file, version_name
  13.     %Q{#{version_name}_#{for_file.chomp(File.extname(for_file))}.png}
  14.   end
  15. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top