lib/vtools/thumbnailer.rb in vtools-0.1.0 vs lib/vtools/thumbnailer.rb in vtools-0.1.1
- old
+ new
@@ -34,11 +34,13 @@
file = "#{@output_file}#{ postfix || (options && options[:t]) || count }.jpg"
exec = "#{command} -t #{seconds} -o '#{file}' 2>&1"
options = nil
Open3.popen3(exec) do |stdin, stdout, stderr|
+ lines = stdout.readlines.join(" ")
+ VTools.fix_encoding lines
# save thumb if no error
- if (error = VTools.fix_encoding(stdout.readlines).join(" ")).empty?
+ if (error = lines).empty?
thumbs << thumb = {:path => file, :offset => time_offset(seconds)}
Handler.exec :in_thumb, @video, thumb # callbacks
else
errors << "#{error} (#{file})"