paperclip-av-transcoder 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49b96b030b3b02bf3b54a25b1a83941cecf68ae1
4
- data.tar.gz: 488f2c30830a67a17f2d99517df1ed7ffafdd25f
3
+ metadata.gz: ea21b7a277ffa9f666d26ed95b469a6ee4afa7b4
4
+ data.tar.gz: e6c81e05cbecb7f258bcc02e8cafdddedfdb35e0
5
5
  SHA512:
6
- metadata.gz: 651815d9159d9b32ee83f9df60bca189b89bd482fce62077a93b12b448a7e1298461e5c87ab78b460f812a480d6b2e61fa18c7804542d7949fe3adc0820fb25e
7
- data.tar.gz: 89b6a56b799aade2aab07399dcf46d7c49c81ce67f8dd6b009d50703583bc90fb7123224d1147bca76c4cbe9aa54ff379a499ef5b207d6cb8aae99cd266ac8d1
6
+ metadata.gz: e4f800b29571e09eebaf76bb888a6b56cdb6b3baf1d41f35db19bcb99061221f9a32dfc5dc8a80f9da21f34534c3d4e452150a668ef54718cf4bb6ce18dbb28f
7
+ data.tar.gz: 8b960fcca8db70c7436ea4d724bb188754979473cf6bcfd3e3495acbc5ded65ab412d8f0ae25df503a3cefccbc07d22e95d09e34905a4db8af757f17c4168367
@@ -1,7 +1,7 @@
1
1
  module Paperclip
2
2
  module Av
3
3
  module Transcoder
4
- VERSION = "0.6.2"
4
+ VERSION = "0.6.3"
5
5
  end
6
6
  end
7
7
  end
@@ -14,10 +14,11 @@ module Paperclip
14
14
  @cli = ::Av.cli
15
15
  @meta = ::Av.cli.identify(@file.path)
16
16
  @whiny = options[:whiny].nil? ? true : options[:whiny]
17
-
18
- @convert_options = options[:convert_options]
17
+
18
+ @convert_options = set_convert_options(options)
19
+
19
20
  @format = options[:format]
20
-
21
+
21
22
  @geometry = options[:geometry]
22
23
  unless @geometry.nil?
23
24
  modifier = @geometry[0]
@@ -28,14 +29,16 @@ module Paperclip
28
29
  @enlarge_only = @keep_aspect && modifier == '<'
29
30
  @shrink_only = @keep_aspect && modifier == '>'
30
31
  end
31
-
32
+
32
33
  @time = options[:time].nil? ? 3 : options[:time]
33
34
  @auto_rotate = options[:auto_rotate].nil? ? false : options[:auto_rotate]
34
35
  @pad_color = options[:pad_color].nil? ? "black" : options[:pad_color]
35
-
36
+
37
+ @convert_options[:output][:s] = format_geometry(@geometry) if @gemotry.present?
38
+
36
39
  attachment.instance_write(:meta, @meta) if attachment
37
40
  end
38
-
41
+
39
42
  # Performs the transcoding of the +file+ into a thumbnail/video. Returns the Tempfile
40
43
  # that contains the new image/video.
41
44
  def make
@@ -43,7 +46,7 @@ module Paperclip
43
46
  @cli.add_source @file
44
47
  dst = Tempfile.new([@basename, @format ? ".#{@format}" : ''])
45
48
  dst.binmode
46
-
49
+
47
50
  if @meta
48
51
  log "Transocding supported file #{@file.path}"
49
52
  @cli.add_source(@file.path)
@@ -76,10 +79,21 @@ module Paperclip
76
79
  end
77
80
  dst
78
81
  end
79
-
82
+
80
83
  def log message
81
84
  Paperclip.log "[transcoder] #{message}"
82
85
  end
86
+
87
+ def set_convert_options options
88
+ return options[:convert_options] if options[:convert_options].present?
89
+ options[:convert_options] = {output: {}}
90
+ return options[:convert_options]
91
+ end
92
+
93
+ def format_geometry geometry
94
+ return unless geometry.present?
95
+ return geometry.gsub(/[#!<>)]/, '')
96
+ end
83
97
  end
84
98
 
85
99
  class Attachment
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "coveralls"
27
27
 
28
28
  spec.add_dependency "paperclip", ">=2.5.2"
29
- spec.add_dependency "av", ">= 0.7.1"
29
+ spec.add_dependency "av", "~> 0.8.1"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-av-transcoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: av
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.7.1
117
+ version: 0.8.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 0.7.1
124
+ version: 0.8.1
125
125
  description: Audio/Video Transcoder for Paperclip using FFMPEG/Avconv
126
126
  email:
127
127
  - owahab@gmail.com
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.0.3
170
+ rubygems_version: 2.4.5
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Audio/Video Transcoder for Paperclip using FFMPEG/Avconv