video_sprites 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/video_sprites/cli.rb +6 -5
- data/lib/video_sprites/processor.rb +17 -1
- data/lib/video_sprites/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fd798b6e90c856b1e6f8cf1ab7807823e639726
|
4
|
+
data.tar.gz: 1580221398ed8fa6b3449d2548b682983b2a9c42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ccac2aeaeb83ed3c826ed662173b02be66517ff79735b3d083754664c7a004bbf1a21b53a48fa899d733a04d4dd31e111fb4660ed972871db9ef60e0809219b
|
7
|
+
data.tar.gz: a608846ad6850db96ec0b5845438784ef17b78ba8b535af0a1ba0685b7fd75063fd5735be1521fd712bef755aed9ed57ff86d15029310e90b57cac5cd65321c6
|
data/README.md
CHANGED
data/lib/video_sprites/cli.rb
CHANGED
@@ -3,11 +3,12 @@ module VideoSprites
|
|
3
3
|
class CLI < Thor
|
4
4
|
|
5
5
|
desc "process <input_file> <output_directory>", "Create video thumbnail sprites"
|
6
|
-
option :seconds,
|
7
|
-
option :width,
|
8
|
-
option :columns,
|
9
|
-
option :group,
|
10
|
-
option :gif,
|
6
|
+
option :seconds, default: 10, type: :numeric
|
7
|
+
option :width, default: 200, type: :numeric
|
8
|
+
option :columns, default: 5, type: :numeric
|
9
|
+
option :group, default: 20, type: :numeric
|
10
|
+
option :gif, default: false, type: :boolean
|
11
|
+
option :keep_images, default: false, type: :boolean
|
11
12
|
def process(input_file, output_directory)
|
12
13
|
processor = VideoSprites::Processor.new(input_file, output_directory, options)
|
13
14
|
processor.process
|
@@ -13,6 +13,9 @@ module VideoSprites
|
|
13
13
|
create_sprites
|
14
14
|
create_webvtt
|
15
15
|
create_gif if @options[:gif]
|
16
|
+
if @options[:keep_images]
|
17
|
+
move_images
|
18
|
+
end
|
16
19
|
clean_temporary_directory
|
17
20
|
end
|
18
21
|
|
@@ -135,7 +138,7 @@ module VideoSprites
|
|
135
138
|
|
136
139
|
# TODO: make basename configurable
|
137
140
|
def basename
|
138
|
-
"
|
141
|
+
"sprites"
|
139
142
|
end
|
140
143
|
|
141
144
|
def original_height
|
@@ -159,6 +162,19 @@ module VideoSprites
|
|
159
162
|
format("%02d:%02d:%02d", hours, minutes, seconds)
|
160
163
|
end
|
161
164
|
|
165
|
+
def move_images
|
166
|
+
FileUtils.mkdir keep_images_directory unless File.exist? keep_images_directory
|
167
|
+
FileUtils.mv Dir.glob(temporary_directory_glob), keep_images_directory
|
168
|
+
end
|
169
|
+
|
170
|
+
def keep_images_directory
|
171
|
+
File.join @output_directory, 'images'
|
172
|
+
end
|
173
|
+
|
174
|
+
def temporary_directory_glob
|
175
|
+
File.join @temporary_directory, '*.jpg'
|
176
|
+
end
|
177
|
+
|
162
178
|
def clean_temporary_directory
|
163
179
|
FileUtils.rm_rf @temporary_directory
|
164
180
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_sprites
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Ronallo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|