paperclip-ffmpeg 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,7 @@ module Paperclip
34
34
  @current_format = File.extname(@file.path)
35
35
  @basename = File.basename(@file.path, @current_format)
36
36
  @meta = identify
37
+ @pad_color = options[:pad_color].nil? ? "black" : options[:pad_color]
37
38
  attachment.instance_write(:meta, @meta)
38
39
  end
39
40
  # Performs the transcoding of the +file+ into a thumbnail/video. Returns the Tempfile
@@ -83,7 +84,7 @@ module Paperclip
83
84
  # We should add half the delta as a padding offset Y
84
85
  pad_y = (target_height.to_f - height.to_f) / 2
85
86
  if pad_y > 0
86
- @convert_options[:output][:vf] = "scale=#{width}:-1,pad=#{width.to_i}:#{target_height.to_i}:0:#{pad_y}:black"
87
+ @convert_options[:output][:vf] = "scale=#{width}:-1,pad=#{width.to_i}:#{target_height.to_i}:0:#{pad_y}:#@pad_color"
87
88
  else
88
89
  @convert_options[:output][:vf] = "scale=#{width}:-1,crop=#{width.to_i}:#{height.to_i}"
89
90
  end
@@ -127,7 +128,7 @@ module Paperclip
127
128
 
128
129
  def identify
129
130
  meta = {}
130
- command = "ffmpeg -i #{File.expand_path(@file.path)} 2>&1"
131
+ command = "ffmpeg -i \"#{File.expand_path(@file.path)}\" 2>&1"
131
132
  Paperclip.log(command)
132
133
  ffmpeg = IO.popen(command)
133
134
  ffmpeg.each("\r") do |line|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "paperclip-ffmpeg"
6
- s.version = '0.9.0'
6
+ s.version = '0.9.1'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Omar Abdel-Wahab"]
9
9
  s.email = ["owahab@gmail.com"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: paperclip-ffmpeg
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.0
5
+ version: 0.9.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Omar Abdel-Wahab
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-08 00:00:00 +02:00
14
- default_executable:
13
+ date: 2012-08-15 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: paperclip
@@ -42,7 +41,6 @@ files:
42
41
  - lib/processors/ffmpeg.rb
43
42
  - lib/processors/qtfaststart.rb
44
43
  - paperclip-ffmpeg.gemspec
45
- has_rdoc: true
46
44
  homepage: http://github.com/owahab/paperclip-ffmpeg
47
45
  licenses: []
48
46
 
@@ -66,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
64
  requirements: []
67
65
 
68
66
  rubyforge_project: paperclip-ffmpeg
69
- rubygems_version: 1.5.2
67
+ rubygems_version: 1.8.24
70
68
  signing_key:
71
69
  specification_version: 3
72
70
  summary: Process your attachments with FFMPEG