imagetools 1.5.2 → 1.6.0
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 +4 -4
- data/.idea/misc.xml +1 -1
- data/.idea/workspace.xml +75 -6
- data/.ruby-version +1 -1
- data/Gemfile.lock +6 -4
- data/README.md +107 -14
- data/imagetools.iml +49 -51
- data/lib/imagetools/imageconcat.rb +3 -2
- data/lib/imagetools/imagefilter.rb +1 -1
- data/lib/imagetools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0335806116e97fe67585ed147307f59b4ec0d66d113136edd6dd47cde66c6d7
|
|
4
|
+
data.tar.gz: e0fd06c71d4723155a6da78fae5ca80a9c60816a710f320d158a5ceeb35a3b08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62eb24fdf16f42f1144ca8d2f28c39f77314f20f202ce66103f4d932fec7725c5b39a556e607ff26bba03075f3e4784a973d2d665467254ada3ccee1f1ec37af
|
|
7
|
+
data.tar.gz: f778694e55b59655c473dad77bbbea978650f22a6e094e851ef29dfe31792fe2b54305314dcc91811f8429e529192db42389a027ff8c05aa89b946514db795f1
|
data/.idea/misc.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="rbenv:
|
|
3
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="rbenv: 3.0.4" project-jdk-type="RUBY_SDK">
|
|
4
4
|
<output url="file://$PROJECT_DIR$/out" />
|
|
5
5
|
</component>
|
|
6
6
|
</project>
|
data/.idea/workspace.xml
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ChangeListManager">
|
|
4
|
-
<list default="true" id="b197c64f-57f8-4389-ab8d-dc9fe3cb05ba" name="Default" comment=""
|
|
4
|
+
<list default="true" id="b197c64f-57f8-4389-ab8d-dc9fe3cb05ba" name="Default" comment="">
|
|
5
|
+
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
7
|
+
<change beforePath="$PROJECT_DIR$/.ruby-version" beforeDir="false" afterPath="$PROJECT_DIR$/.ruby-version" afterDir="false" />
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/imagetools.iml" beforeDir="false" afterPath="$PROJECT_DIR$/imagetools.iml" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/lib/imagetools/imageconcat.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/imagetools/imageconcat.rb" afterDir="false" />
|
|
12
|
+
<change beforePath="$PROJECT_DIR$/lib/imagetools/imagefilter.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/imagetools/imagefilter.rb" afterDir="false" />
|
|
13
|
+
<change beforePath="$PROJECT_DIR$/lib/imagetools/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/imagetools/version.rb" afterDir="false" />
|
|
14
|
+
</list>
|
|
5
15
|
<option name="SHOW_DIALOG" value="false" />
|
|
6
16
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
7
17
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -18,6 +28,12 @@
|
|
|
18
28
|
<component name="Git.Settings">
|
|
19
29
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
20
30
|
</component>
|
|
31
|
+
<component name="HighlightingSettingsPerFile">
|
|
32
|
+
<setting file="file://$PROJECT_DIR$/exe/imageconcat" root0="FORCE_HIGHLIGHTING" />
|
|
33
|
+
<setting file="file://$PROJECT_DIR$/test_imageconcat.sh" root0="FORCE_HIGHLIGHTING" />
|
|
34
|
+
<setting file="file://$USER_HOME$/.anyenv/envs/rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/imagetools-1.5.2/lib/imagetools/imageconcat.rb" root0="FORCE_HIGHLIGHTING" />
|
|
35
|
+
<setting file="file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb" root0="FORCE_HIGHLIGHTING" />
|
|
36
|
+
</component>
|
|
21
37
|
<component name="ProjectFrameBounds">
|
|
22
38
|
<option name="x" value="254" />
|
|
23
39
|
<option name="y" value="418" />
|
|
@@ -44,12 +60,12 @@
|
|
|
44
60
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
|
45
61
|
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
|
46
62
|
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
|
47
|
-
<property name="project.structure.last.edited" value="
|
|
48
|
-
<property name="project.structure.proportion" value="0.
|
|
49
|
-
<property name="project.structure.side.proportion" value="0.
|
|
63
|
+
<property name="project.structure.last.edited" value="Modules" />
|
|
64
|
+
<property name="project.structure.proportion" value="0.15" />
|
|
65
|
+
<property name="project.structure.side.proportion" value="0.208413" />
|
|
50
66
|
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
|
|
51
67
|
</component>
|
|
52
|
-
<component name="RunManager">
|
|
68
|
+
<component name="RunManager" selected="Ruby.imageconcat">
|
|
53
69
|
<configuration default="true" type="Application" factoryName="Application">
|
|
54
70
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
55
71
|
<method v="2">
|
|
@@ -84,6 +100,27 @@
|
|
|
84
100
|
<option name="Make" enabled="true" />
|
|
85
101
|
</method>
|
|
86
102
|
</configuration>
|
|
103
|
+
<configuration name="imageconcat" type="RubyRunConfigurationType" factoryName="Ruby">
|
|
104
|
+
<module name="imagetools" />
|
|
105
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
|
|
106
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
|
107
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
|
108
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
|
109
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
|
110
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
|
111
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
|
112
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_FORKED_COVERAGE="true">
|
|
113
|
+
<COVERAGE_PATTERN ENABLED="true">
|
|
114
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
|
115
|
+
</COVERAGE_PATTERN>
|
|
116
|
+
</EXTENSION>
|
|
117
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
|
118
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$PROJECT_DIR$/exe/imageconcat" />
|
|
119
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="-n 2 ~/tmp2" />
|
|
120
|
+
<method v="2">
|
|
121
|
+
<option name="Make" enabled="true" />
|
|
122
|
+
</method>
|
|
123
|
+
</configuration>
|
|
87
124
|
<configuration default="true" type="TestNG">
|
|
88
125
|
<option name="TEST_OBJECT" value="CLASS" />
|
|
89
126
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
|
@@ -102,6 +139,10 @@
|
|
|
102
139
|
<option name="Make" enabled="true" />
|
|
103
140
|
</method>
|
|
104
141
|
</configuration>
|
|
142
|
+
<list>
|
|
143
|
+
<item itemvalue="Ruby.iconcreator" />
|
|
144
|
+
<item itemvalue="Ruby.imageconcat" />
|
|
145
|
+
</list>
|
|
105
146
|
</component>
|
|
106
147
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
107
148
|
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="false" RAILS_SPRING_PRE_LOADER_OPTION="false" />
|
|
@@ -117,11 +158,13 @@
|
|
|
117
158
|
<workItem from="1570340436196" duration="217000" />
|
|
118
159
|
<workItem from="1583825074054" duration="96000" />
|
|
119
160
|
<workItem from="1646719315550" duration="10000" />
|
|
161
|
+
<workItem from="1669361560975" duration="7318000" />
|
|
162
|
+
<workItem from="1669384174219" duration="1374000" />
|
|
120
163
|
</task>
|
|
121
164
|
<servers />
|
|
122
165
|
</component>
|
|
123
166
|
<component name="TypeScriptGeneratedFilesManager">
|
|
124
|
-
<option name="version" value="
|
|
167
|
+
<option name="version" value="3" />
|
|
125
168
|
</component>
|
|
126
169
|
<component name="Vcs.Log.History.Properties">
|
|
127
170
|
<option name="COLUMN_ORDER">
|
|
@@ -133,6 +176,32 @@
|
|
|
133
176
|
</list>
|
|
134
177
|
</option>
|
|
135
178
|
</component>
|
|
179
|
+
<component name="XDebuggerManager">
|
|
180
|
+
<breakpoint-manager>
|
|
181
|
+
<breakpoints>
|
|
182
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
|
183
|
+
<url>file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb</url>
|
|
184
|
+
<line>30</line>
|
|
185
|
+
<properties myBlockOrdinal="-1">
|
|
186
|
+
<option name="block-ordinal" value="-1" />
|
|
187
|
+
</properties>
|
|
188
|
+
<option name="timeStamp" value="7" />
|
|
189
|
+
</line-breakpoint>
|
|
190
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
|
191
|
+
<url>file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb</url>
|
|
192
|
+
<line>44</line>
|
|
193
|
+
<properties myBlockOrdinal="-1">
|
|
194
|
+
<option name="block-ordinal" value="-1" />
|
|
195
|
+
</properties>
|
|
196
|
+
<option name="timeStamp" value="8" />
|
|
197
|
+
</line-breakpoint>
|
|
198
|
+
</breakpoints>
|
|
199
|
+
</breakpoint-manager>
|
|
200
|
+
</component>
|
|
201
|
+
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
|
202
|
+
<SUITE FILE_PATH="coverage/imagetools@imageconcat.rcov" NAME="imageconcat Coverage Results" MODIFIED="1669384701671" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="imagetools" />
|
|
203
|
+
<SUITE FILE_PATH="coverage/imagetools@iconcreator.rcov" NAME="iconcreator Coverage Results" MODIFIED="1669377776099" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/exe" MODULE_NAME="imagetools" />
|
|
204
|
+
</component>
|
|
136
205
|
<component name="masterDetails">
|
|
137
206
|
<states>
|
|
138
207
|
<state key="ProjectJDKs.UI">
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.0.
|
|
1
|
+
3.0.4
|
data/Gemfile.lock
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
imagetools (1.
|
|
4
|
+
imagetools (1.6.0)
|
|
5
5
|
rmagick
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
minitest (5.
|
|
10
|
+
minitest (5.16.3)
|
|
11
|
+
pkg-config (1.5.1)
|
|
11
12
|
rake (13.0.6)
|
|
12
|
-
rmagick (
|
|
13
|
+
rmagick (5.1.0)
|
|
14
|
+
pkg-config (~> 1.4)
|
|
13
15
|
|
|
14
16
|
PLATFORMS
|
|
15
17
|
ruby
|
|
@@ -21,4 +23,4 @@ DEPENDENCIES
|
|
|
21
23
|
rake (~> 13.0)
|
|
22
24
|
|
|
23
25
|
BUNDLED WITH
|
|
24
|
-
2.3.
|
|
26
|
+
2.3.19
|
data/README.md
CHANGED
|
@@ -1,33 +1,129 @@
|
|
|
1
1
|
# Imagetools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ruby製の画像ツールコレクションです。以下のツールを含みます(※はプレビュー版です)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- iconcreator(※): Xcodeで使用するアプリ用アイコンの作成
|
|
6
|
+
- iconextractor(※): .appからアイコン画像の抽出
|
|
7
|
+
- imageblog(※): ブログ用の連番画像生成(hugoを想定)
|
|
8
|
+
- imageburst(※): 動画ファイルを連続キャプチャ
|
|
9
|
+
- imageconcat: 画像の連結
|
|
10
|
+
- imagefilter: 画像変換(WordPress用画像を想定)
|
|
11
|
+
- imageresizer(※): 画像サイズ変換(WordPress用画像を想定)
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
一部外部コマンドを使用するため、macOS上のRuby 3.xでの動作を想定しています。
|
|
14
|
+
|
|
15
|
+
## インストール
|
|
10
16
|
|
|
11
|
-
macOS High Sierra
|
|
12
17
|
|
|
18
|
+
ImageMagick v6が必要です。以下のコマンドでインストールします。
|
|
19
|
+
|
|
20
|
+
Homebrewの場合
|
|
13
21
|
```
|
|
14
22
|
brew uninstall imagemagick
|
|
15
23
|
brew install imagemagick@6
|
|
16
|
-
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem imagetools
|
|
24
|
+
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install imagetools
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
MacPosrtsの場合
|
|
28
|
+
```
|
|
29
|
+
sudo port install imagemagick
|
|
30
|
+
gem install imagetools
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
imagefilterを使用する場合、追加で以下の外部コマンドも必要です
|
|
34
|
+
|
|
35
|
+
- convert、mogrify: ImageMagicをインストールすれば使えるはず。
|
|
36
|
+
- dweb: WebP画像を扱う。
|
|
37
|
+
- exiftran: EXIF情報を削除。
|
|
38
|
+
- jpegoptim: JPEG画像の圧縮。
|
|
39
|
+
|
|
40
|
+
Homebrewの場合
|
|
41
|
+
```
|
|
42
|
+
brew install webp jpegoptim exiftran
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
MacPortsの場合
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
sudo port install webp jpegoptim exiftran
|
|
17
49
|
```
|
|
18
50
|
|
|
19
51
|
|
|
20
|
-
##
|
|
52
|
+
## 使用方法
|
|
21
53
|
|
|
22
54
|
### imageconcat
|
|
23
55
|
|
|
56
|
+
画像ファイルを連結します。
|
|
57
|
+
|
|
58
|
+
image1.jpg、image2.jpg、image3.jpgを連結し、カレントフォルダにphoto.jpgを出力。
|
|
59
|
+
```
|
|
60
|
+
imageconcat image1.jpg image2.jpg image3.jpg
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
カレントフォルダに存在する画像ファイルを全て取得してソートして最後の2個を連結し、カレントフォルダにphoto.jpgを出力。
|
|
64
|
+
```
|
|
65
|
+
imageconcat -n 2 ~/tmp
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
以下のオプションが指定可能です。
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
$ imageconcat
|
|
72
|
+
Usage: imageconcat [-h|--help] <dir> or <image1 image2 image3 ...>
|
|
73
|
+
-h, --help Show this message
|
|
74
|
+
|
|
75
|
+
Examples:
|
|
76
|
+
imageconcat ~/tmp # concat two recent IMG_*jpg images.
|
|
77
|
+
imageconcat image1.jpg image2.jpg image3.jpg # concat specified images.
|
|
78
|
+
|
|
79
|
+
Options:
|
|
80
|
+
-v, --verbose Verbose message
|
|
81
|
+
--dry-run Message only
|
|
82
|
+
-o, --output=OUTNAME Output file
|
|
83
|
+
-n, --number=NUM Concat image number
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
|
|
24
87
|
### imagefilter
|
|
25
88
|
|
|
26
|
-
|
|
89
|
+
画像ファイルを適切に処理しブログで使いやすく変換します。
|
|
90
|
+
|
|
91
|
+
image1.pngが処理され、image1.jpgが作成されます。
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
imagefilter image1.png
|
|
95
|
+
```
|
|
27
96
|
|
|
28
|
-
|
|
97
|
+
内部では以下の処理を順番に実行し、最終的にJPEGファイルを作成します。
|
|
29
98
|
|
|
30
|
-
|
|
99
|
+
- 画像のリネーム
|
|
100
|
+
- WebPのPNGへの変換
|
|
101
|
+
- PENGのJPEGへの変換
|
|
102
|
+
- JPEGのリサイズ
|
|
103
|
+
- 画像の回転(カメラで撮影した画像を適切な向きに)
|
|
104
|
+
- 画像の圧縮
|
|
105
|
+
|
|
106
|
+
一部の挙動は設定ファイル`~/.imagefilterrc`で制御できます。
|
|
107
|
+
ファイル名の検索・置換パターンが3つまでとリサイズ後の最大幅が指定できます。
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
filename:
|
|
111
|
+
search1: s (\d+)-(\d+)-(\d+) (\d+)\.(\d+)\.(\d+)
|
|
112
|
+
replace1: s_\1\2\3_\4\5\6
|
|
113
|
+
search2: foo
|
|
114
|
+
replace2: bar
|
|
115
|
+
search3: fizz
|
|
116
|
+
replace3: buzz
|
|
117
|
+
resize:
|
|
118
|
+
width: 1280
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Hazelなどの自動化ツールと組みあせると便利です。
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### iconcreator
|
|
125
|
+
|
|
126
|
+
iOSアプリ用のアイコンファイルを生成します。
|
|
31
127
|
|
|
32
128
|

|
|
33
129
|
|
|
@@ -35,9 +131,6 @@ Xcode Version 9.2 AppIcon.
|
|
|
35
131
|
iconcreator -i <ORIGINAL_ICON_FILE> -o <OUTPUT_DIR>
|
|
36
132
|
```
|
|
37
133
|
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
TODO: Write usage instructions here
|
|
41
134
|
|
|
42
135
|
|
|
43
136
|
## License
|
data/imagetools.iml
CHANGED
|
@@ -3,96 +3,94 @@
|
|
|
3
3
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
4
|
<exclude-output />
|
|
5
5
|
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="jdk" jdkName="rbenv: 3.0.
|
|
6
|
+
<orderEntry type="jdk" jdkName="rbenv: 3.0.4" jdkType="RUBY_SDK" />
|
|
7
7
|
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
8
|
<orderEntry type="module-library">
|
|
9
|
-
<library name="minitest (vbundled(5.
|
|
9
|
+
<library name="minitest (vbundled(5.16.3)) [path][gem]" type="rubylib">
|
|
10
10
|
<properties>
|
|
11
11
|
<option name="version" value="4" />
|
|
12
12
|
</properties>
|
|
13
13
|
<CLASSES>
|
|
14
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
15
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
14
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.16.3/lib" />
|
|
15
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.16.3/test" />
|
|
16
16
|
</CLASSES>
|
|
17
17
|
<JAVADOC />
|
|
18
18
|
<SOURCES>
|
|
19
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
20
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
19
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.16.3/lib" />
|
|
20
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.16.3/test" />
|
|
21
21
|
</SOURCES>
|
|
22
22
|
<excluded>
|
|
23
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
23
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.16.3/test" />
|
|
24
24
|
</excluded>
|
|
25
25
|
</library>
|
|
26
26
|
</orderEntry>
|
|
27
27
|
<orderEntry type="module-library">
|
|
28
|
-
<library name="
|
|
28
|
+
<library name="pkg-config (vbundled(1.5.1)) [path][gem]" type="rubylib">
|
|
29
29
|
<properties>
|
|
30
30
|
<option name="version" value="4" />
|
|
31
31
|
</properties>
|
|
32
32
|
<CLASSES>
|
|
33
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
34
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
35
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe" />
|
|
36
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib" />
|
|
37
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/.github" />
|
|
33
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/pkg-config-1.5.1/lib" />
|
|
34
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/pkg-config-1.5.1/test" />
|
|
38
35
|
</CLASSES>
|
|
39
36
|
<JAVADOC />
|
|
40
37
|
<SOURCES>
|
|
41
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
42
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
43
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe" />
|
|
44
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib" />
|
|
45
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/.github" />
|
|
38
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/pkg-config-1.5.1/lib" />
|
|
39
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/pkg-config-1.5.1/test" />
|
|
46
40
|
</SOURCES>
|
|
47
41
|
<excluded>
|
|
48
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
49
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/doc" />
|
|
50
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe" />
|
|
51
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/.github" />
|
|
42
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/pkg-config-1.5.1/test" />
|
|
52
43
|
</excluded>
|
|
53
44
|
</library>
|
|
54
45
|
</orderEntry>
|
|
55
46
|
<orderEntry type="module-library">
|
|
56
|
-
<library name="
|
|
47
|
+
<library name="rake (vbundled(13.0.6)) [path][gem]" type="rubylib">
|
|
57
48
|
<properties>
|
|
58
49
|
<option name="version" value="4" />
|
|
59
50
|
</properties>
|
|
60
51
|
<CLASSES>
|
|
61
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
62
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
63
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
64
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/spec" />
|
|
65
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/test" />
|
|
66
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/examples" />
|
|
67
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/.circleci" />
|
|
68
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/benchmarks" />
|
|
69
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/deprecated" />
|
|
52
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc" />
|
|
53
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe" />
|
|
54
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib" />
|
|
70
55
|
</CLASSES>
|
|
71
56
|
<JAVADOC />
|
|
72
57
|
<SOURCES>
|
|
73
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
74
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
75
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
76
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/spec" />
|
|
77
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/test" />
|
|
78
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/examples" />
|
|
79
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/.circleci" />
|
|
80
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/benchmarks" />
|
|
81
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/deprecated" />
|
|
58
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc" />
|
|
59
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe" />
|
|
60
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib" />
|
|
82
61
|
</SOURCES>
|
|
83
62
|
<excluded>
|
|
84
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
85
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/
|
|
86
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/spec" />
|
|
87
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/test" />
|
|
88
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/examples" />
|
|
89
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/.circleci" />
|
|
90
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/benchmarks" />
|
|
91
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/2.6.0/gems/rmagick-3.2.0/deprecated" />
|
|
63
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/doc" />
|
|
64
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe" />
|
|
92
65
|
</excluded>
|
|
93
66
|
</library>
|
|
94
67
|
</orderEntry>
|
|
95
|
-
<orderEntry type="library"
|
|
96
|
-
|
|
68
|
+
<orderEntry type="module-library">
|
|
69
|
+
<library name="rmagick (vbundled(5.1.0)) [path][gem]" type="rubylib">
|
|
70
|
+
<properties>
|
|
71
|
+
<option name="version" value="4" />
|
|
72
|
+
</properties>
|
|
73
|
+
<CLASSES>
|
|
74
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/ext" />
|
|
75
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/lib" />
|
|
76
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.github" />
|
|
77
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.devcontainer" />
|
|
78
|
+
</CLASSES>
|
|
79
|
+
<JAVADOC />
|
|
80
|
+
<SOURCES>
|
|
81
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/ext" />
|
|
82
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/lib" />
|
|
83
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.github" />
|
|
84
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.devcontainer" />
|
|
85
|
+
</SOURCES>
|
|
86
|
+
<excluded>
|
|
87
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/ext" />
|
|
88
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.github" />
|
|
89
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.1.0/.devcontainer" />
|
|
90
|
+
</excluded>
|
|
91
|
+
</library>
|
|
92
|
+
</orderEntry>
|
|
93
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.19, rbenv: 3.0.4) [gem]" level="application" />
|
|
94
|
+
<orderEntry type="library" scope="PROVIDED" name="rbs (v1.4.0, rbenv: 3.0.4) [gem]" level="application" />
|
|
97
95
|
</component>
|
|
98
96
|
</module>
|
|
@@ -30,6 +30,7 @@ module Imagetools
|
|
|
30
30
|
opt.parse!(argv)
|
|
31
31
|
image_files = get_image_files(opts, argv)
|
|
32
32
|
if image_files.size < 2
|
|
33
|
+
puts "Cannot find image files(#{image_files.size})\n"
|
|
33
34
|
puts opt.help
|
|
34
35
|
exit
|
|
35
36
|
end
|
|
@@ -53,9 +54,9 @@ module Imagetools
|
|
|
53
54
|
end
|
|
54
55
|
if dir
|
|
55
56
|
concat_number = opts[:n] || 2
|
|
56
|
-
#
|
|
57
|
+
# ディレクトリが指定されていた場合、指定ディレクトリ内の画像ファイルの最新n個を対象とする
|
|
57
58
|
# 最新の基準は(ファイル名基準)
|
|
58
|
-
match_files = Dir.glob("#{dir}
|
|
59
|
+
match_files = Dir.glob("#{dir}/*.{jpg,jpeg,png}", File::FNM_CASEFOLD).sort
|
|
59
60
|
# 後ろからn個を取得(小さい方の数とする)
|
|
60
61
|
count = [match_files.size, concat_number].min
|
|
61
62
|
image_files = match_files[-count..-1]
|
|
@@ -67,7 +67,7 @@ module Imagetools
|
|
|
67
67
|
RESIZE_CMD = "mogrify -background white -resize %dx\\> "
|
|
68
68
|
ROTATE_CMD = "exiftran -ai "
|
|
69
69
|
COMPRESS_CMD = "jpegoptim --strip-all --max=90 "
|
|
70
|
-
EXTERNAL_CMDS = [RESIZE_CMD, ROTATE_CMD, COMPRESS_CMD]
|
|
70
|
+
EXTERNAL_CMDS = [CONVERT_CMD, RESIZE_CMD, ROTATE_CMD, COMPRESS_CMD, DWEBP_CMD]
|
|
71
71
|
|
|
72
72
|
WEBP_SEARCH = /(.+)\.webp/i
|
|
73
73
|
WEBP_REPLACE = '\1.png'
|
data/lib/imagetools/version.rb
CHANGED
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: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- src
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-11-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rmagick
|
|
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
182
182
|
- !ruby/object:Gem::Version
|
|
183
183
|
version: '0'
|
|
184
184
|
requirements: []
|
|
185
|
-
rubygems_version: 3.2.
|
|
185
|
+
rubygems_version: 3.2.33
|
|
186
186
|
signing_key:
|
|
187
187
|
specification_version: 4
|
|
188
188
|
summary: Image Tools.
|