imagetools 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/appicon.png +0 -0
- data/exe/imageburst +5 -0
- data/lib/imagetools/imageburst.rb +82 -0
- data/lib/imagetools/version.rb +1 -1
- data/test_imageburst.sh +3 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfac86e4f981cac7a5315792851b00929b4d36d7d85ce42d3e09d6e9acfeb91b
|
4
|
+
data.tar.gz: bc72a7079d91f6fa31503d9bf6ed04cc4fd82b078a5d53eb5c03b3cd450432d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 158b2146ff16f2db7185b409784c168a28a71df3ba2146e890c1a77185fecc6d41ac6ef8488f76984b701b3a06414a447e23f066c0f7071e34d5830c9ecfb934
|
7
|
+
data.tar.gz: 9c43a8f7a4dedd66c6e4ca1a3be412e799cb2dde18c3ae7916899e114305009a154e506dddf7483603051a065450a8c86b119950a40c806e42db759367e127aa
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/appicon.png
CHANGED
Binary file
|
data/exe/imageburst
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require 'imagetools/version'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
module Imagetools
|
7
|
+
class Imageburst
|
8
|
+
|
9
|
+
BASE_FOLDER = "~/Documents/capture"
|
10
|
+
DEFAULAT_TIME = 180
|
11
|
+
|
12
|
+
def self.run(argv)
|
13
|
+
STDOUT.sync = true
|
14
|
+
opts = {}
|
15
|
+
opt = OptionParser.new(argv)
|
16
|
+
opt.version = VERSION
|
17
|
+
opt.banner = "Usage: #{opt.program_name} [-h|--help] args"
|
18
|
+
opt.separator('')
|
19
|
+
opt.separator('Options:')
|
20
|
+
opt.on_head('-h', '--help', 'Show this message') do |v|
|
21
|
+
puts opt.help
|
22
|
+
exit
|
23
|
+
end
|
24
|
+
opt.on('-v', '--verbose', 'Verbose message') {|v| opts[:v] = v}
|
25
|
+
opt.on('-p PREFIX', '--prefix PREFIX', 'Capture file prefix.') {|v| opts[:p] = v}
|
26
|
+
opt.on('-D DISPLAY', '--display DISPLAY', Integer, 'Capture from the display specified. -D 1 is main display, -D 2 secondary, etc.') {|v| opts[:d] = v}
|
27
|
+
opt.on('-t TIME', '--time TIME', Integer, 'Recording time.') {|v| opts[:t] = v}
|
28
|
+
opt.parse!(argv)
|
29
|
+
cmd = Imageburst.new(opts)
|
30
|
+
cmd.run
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(opts)
|
34
|
+
@opts = opts
|
35
|
+
end
|
36
|
+
|
37
|
+
def run
|
38
|
+
# 撮影時間
|
39
|
+
time = DEFAULAT_TIME
|
40
|
+
if @opts[:t]
|
41
|
+
time = @opts[:t]
|
42
|
+
end
|
43
|
+
|
44
|
+
# prefixの決定
|
45
|
+
prefix = Time.now.strftime("%Y%m%d_%H%M%S")
|
46
|
+
if @opts[:p]
|
47
|
+
prefix = @opts[:p]
|
48
|
+
end
|
49
|
+
|
50
|
+
# ディスプレイの設定
|
51
|
+
display = ''
|
52
|
+
if @opts[:d]
|
53
|
+
display = "-D#{@opts[:d]}"
|
54
|
+
end
|
55
|
+
|
56
|
+
# 現在時刻
|
57
|
+
current = Time.now
|
58
|
+
# 終了時間
|
59
|
+
finish = current + time
|
60
|
+
|
61
|
+
# 保存フォルダ(ベースフォルダの下に現在日付のフォルダを作成しその下に保存)
|
62
|
+
# session = Time.now.strftime("%Y%m%d_%H%M%S")
|
63
|
+
folder = File.expand_path(File.join(BASE_FOLDER, prefix))
|
64
|
+
if FileTest.directory?(folder)
|
65
|
+
puts "Output folder already exists: #{folder}"
|
66
|
+
exit(1)
|
67
|
+
end
|
68
|
+
Dir.mkdir(folder)
|
69
|
+
|
70
|
+
while current < finish
|
71
|
+
current = Time.now
|
72
|
+
name = current.strftime("%s_%6N.jpg")
|
73
|
+
|
74
|
+
path = File.join(folder, name)
|
75
|
+
cmd = "screencapture #{display} #{path}"
|
76
|
+
puts cmd
|
77
|
+
system(cmd)
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/lib/imagetools/version.rb
CHANGED
data/test_imageburst.sh
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imagetools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- src
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|
@@ -72,6 +72,7 @@ email:
|
|
72
72
|
executables:
|
73
73
|
- iconcreator
|
74
74
|
- iconextractor
|
75
|
+
- imageburst
|
75
76
|
- imageconcat
|
76
77
|
- imagefilter
|
77
78
|
- imageresizer
|
@@ -101,6 +102,7 @@ files:
|
|
101
102
|
- build.sh
|
102
103
|
- exe/iconcreator
|
103
104
|
- exe/iconextractor
|
105
|
+
- exe/imageburst
|
104
106
|
- exe/imageconcat
|
105
107
|
- exe/imagefilter
|
106
108
|
- exe/imageresizer
|
@@ -111,6 +113,7 @@ files:
|
|
111
113
|
- lib/imagetools.rb
|
112
114
|
- lib/imagetools/iconcreator.rb
|
113
115
|
- lib/imagetools/iconextractor.rb
|
116
|
+
- lib/imagetools/imageburst.rb
|
114
117
|
- lib/imagetools/imageconcat.rb
|
115
118
|
- lib/imagetools/imagefilter.rb
|
116
119
|
- lib/imagetools/imageresizer.rb
|
@@ -145,6 +148,7 @@ files:
|
|
145
148
|
- test.sh
|
146
149
|
- test_iconcreator.sh
|
147
150
|
- test_iconextractor.sh
|
151
|
+
- test_imageburst.sh
|
148
152
|
- test_imageconcat.sh
|
149
153
|
- test_imagefilter.sh
|
150
154
|
- test_imageresizer.sh
|