Module: Miniatura
- Defined in:
- lib/miniatura.rb,
lib/miniatura/logger.rb,
lib/miniatura/options.rb,
lib/miniatura/version.rb,
lib/miniatura/generate_command.rb
Defined Under Namespace
Classes: GenerateCommand, Logger, Options
Constant Summary collapse
- VERSION =
'0.4.0'
Instance Method Summary collapse
Instance Method Details
#generate_thumb(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/miniatura.rb', line 8 def generate_thumb( = {}) @exit_code, @error = nil raise Errno::ENOENT unless File.exist?(current_path) [:file_extension] ||= 'jpeg' [:rotate] = 0 [:size] = determine_thumb_dimension_ratio_from_uploaded_video([:size]) tmp_path = generate_temp_file([:file_extension]) cmd = generate_command_for_thumbnail(, tmp_path) show_logs(cmd) execute_command(cmd) handle_exit_code(@exit_code, @error) File.rename tmp_path, current_path end |