From b59cd6ec1024a2bd26e37c7793230f42a1dd53c1 Mon Sep 17 00:00:00 2001 From: Pete Michaud Date: Fri, 28 Sep 2012 11:02:12 -0500 Subject: [PATCH] improved make logging --- lib/paperclip_processors/ffmpeg.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/paperclip_processors/ffmpeg.rb b/lib/paperclip_processors/ffmpeg.rb index 5247787..6ec98cb 100644 --- a/lib/paperclip_processors/ffmpeg.rb +++ b/lib/paperclip_processors/ffmpeg.rb @@ -42,12 +42,14 @@ def initialize file, options = {}, attachment = nil def make Paperclip.log("[ffmpeg] Making...") if @whiny src = @file - Paperclip.log("[ffmpeg] Building Destination File: '#{@basename}' + ''#{@format}'") if @whiny + Paperclip.log("[ffmpeg] Building Destination File: '#{@basename}' + '#{@format}'") if @whiny dst = Tempfile.new([@basename, @format ? ".#{@format}" : '']) Paperclip.log("[ffmpeg] Destination File Built") if @whiny dst.binmode parameters = [] + + Paperclip.log("[ffmpeg] Adding Geometry") if @whiny # Add geometry if @geometry # Extract target dimensions @@ -103,6 +105,8 @@ def make end end end + + Paperclip.log("[ffmpeg] Adding Format") if @whiny # Add format case @format when 'jpg', 'jpeg', 'png', 'gif' # Images @@ -110,13 +114,15 @@ def make @convert_options[:output][:vframes] = 1 @convert_options[:output][:f] = 'image2' end - + + Paperclip.log("[ffmpeg] Adding Source") if @whiny # Add source parameters << @convert_options[:input].map { |k,v| "-#{k.to_s} #{v} "} parameters << "-i :source" parameters << @convert_options[:output].map { |k,v| "-#{k.to_s} #{v} "} parameters << ":dest" + Paperclip.log("[ffmpeg] Building Parameters") if @whiny parameters = parameters.flatten.compact.join(" ").strip.squeeze(" ") Paperclip.log("[ffmpeg] #{parameters}")