paperclip-av-transcoder 0.6.2 → 0.6.3
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea21b7a277ffa9f666d26ed95b469a6ee4afa7b4
|
4
|
+
data.tar.gz: e6c81e05cbecb7f258bcc02e8cafdddedfdb35e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4f800b29571e09eebaf76bb888a6b56cdb6b3baf1d41f35db19bcb99061221f9a32dfc5dc8a80f9da21f34534c3d4e452150a668ef54718cf4bb6ce18dbb28f
|
7
|
+
data.tar.gz: 8b960fcca8db70c7436ea4d724bb188754979473cf6bcfd3e3495acbc5ded65ab412d8f0ae25df503a3cefccbc07d22e95d09e34905a4db8af757f17c4168367
|
@@ -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
|
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
|
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.
|
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:
|
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.
|
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.
|
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.
|
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
|