imagetools 1.5.2 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/misc.xml +1 -1
- data/.idea/workspace.xml +67 -6
- data/.ruby-version +1 -1
- data/Gemfile.lock +6 -4
- data/README.md +112 -13
- data/imagetools.iml +49 -51
- data/lib/imagetools/iconcreator.rb +1 -1
- 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: b0c09a0e718e8e80afa71f207fb0eb68ae6a98cc37ce04a5105d15958a576885
|
4
|
+
data.tar.gz: 2b8fba73e2c5ef832a0cdfb6f00afc3325b23a1a7d6d3a1607e09bf8b9d66d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2b036651994dd9dc0e4de301a903388df4f94ce224263c581be27842057abe3aa4028f6dccbf2a5b2a11fda85767c808b427d25fc360355da5effec4c197ac
|
7
|
+
data.tar.gz: 65b25497223df286e43595d6d2eebb3629183d5a758ef93d36da47d196afd9689a586bbbcb46a6fa3f1ba703ebee86662a41c70d1466c85e9fea77653cee69b8
|
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,9 @@
|
|
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/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6
|
+
</list>
|
5
7
|
<option name="SHOW_DIALOG" value="false" />
|
6
8
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
7
9
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
@@ -18,6 +20,12 @@
|
|
18
20
|
<component name="Git.Settings">
|
19
21
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
20
22
|
</component>
|
23
|
+
<component name="HighlightingSettingsPerFile">
|
24
|
+
<setting file="file://$PROJECT_DIR$/exe/imageconcat" root0="FORCE_HIGHLIGHTING" />
|
25
|
+
<setting file="file://$PROJECT_DIR$/test_imageconcat.sh" root0="FORCE_HIGHLIGHTING" />
|
26
|
+
<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" />
|
27
|
+
<setting file="file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb" root0="FORCE_HIGHLIGHTING" />
|
28
|
+
</component>
|
21
29
|
<component name="ProjectFrameBounds">
|
22
30
|
<option name="x" value="254" />
|
23
31
|
<option name="y" value="418" />
|
@@ -44,12 +52,12 @@
|
|
44
52
|
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
45
53
|
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
46
54
|
<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.
|
55
|
+
<property name="project.structure.last.edited" value="Modules" />
|
56
|
+
<property name="project.structure.proportion" value="0.15" />
|
57
|
+
<property name="project.structure.side.proportion" value="0.208413" />
|
50
58
|
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
|
51
59
|
</component>
|
52
|
-
<component name="RunManager">
|
60
|
+
<component name="RunManager" selected="Ruby.imageconcat">
|
53
61
|
<configuration default="true" type="Application" factoryName="Application">
|
54
62
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
55
63
|
<method v="2">
|
@@ -84,6 +92,27 @@
|
|
84
92
|
<option name="Make" enabled="true" />
|
85
93
|
</method>
|
86
94
|
</configuration>
|
95
|
+
<configuration name="imageconcat" type="RubyRunConfigurationType" factoryName="Ruby">
|
96
|
+
<module name="imagetools" />
|
97
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
|
98
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
99
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
100
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
101
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
102
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
103
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
104
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_FORKED_COVERAGE="true">
|
105
|
+
<COVERAGE_PATTERN ENABLED="true">
|
106
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
107
|
+
</COVERAGE_PATTERN>
|
108
|
+
</EXTENSION>
|
109
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
110
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$PROJECT_DIR$/exe/imageconcat" />
|
111
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="-n 2 ~/tmp2" />
|
112
|
+
<method v="2">
|
113
|
+
<option name="Make" enabled="true" />
|
114
|
+
</method>
|
115
|
+
</configuration>
|
87
116
|
<configuration default="true" type="TestNG">
|
88
117
|
<option name="TEST_OBJECT" value="CLASS" />
|
89
118
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
@@ -102,6 +131,10 @@
|
|
102
131
|
<option name="Make" enabled="true" />
|
103
132
|
</method>
|
104
133
|
</configuration>
|
134
|
+
<list>
|
135
|
+
<item itemvalue="Ruby.iconcreator" />
|
136
|
+
<item itemvalue="Ruby.imageconcat" />
|
137
|
+
</list>
|
105
138
|
</component>
|
106
139
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
107
140
|
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="false" RAILS_SPRING_PRE_LOADER_OPTION="false" />
|
@@ -117,11 +150,13 @@
|
|
117
150
|
<workItem from="1570340436196" duration="217000" />
|
118
151
|
<workItem from="1583825074054" duration="96000" />
|
119
152
|
<workItem from="1646719315550" duration="10000" />
|
153
|
+
<workItem from="1669361560975" duration="7318000" />
|
154
|
+
<workItem from="1669384174219" duration="2215000" />
|
120
155
|
</task>
|
121
156
|
<servers />
|
122
157
|
</component>
|
123
158
|
<component name="TypeScriptGeneratedFilesManager">
|
124
|
-
<option name="version" value="
|
159
|
+
<option name="version" value="3" />
|
125
160
|
</component>
|
126
161
|
<component name="Vcs.Log.History.Properties">
|
127
162
|
<option name="COLUMN_ORDER">
|
@@ -133,6 +168,32 @@
|
|
133
168
|
</list>
|
134
169
|
</option>
|
135
170
|
</component>
|
171
|
+
<component name="XDebuggerManager">
|
172
|
+
<breakpoint-manager>
|
173
|
+
<breakpoints>
|
174
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
175
|
+
<url>file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb</url>
|
176
|
+
<line>30</line>
|
177
|
+
<properties myBlockOrdinal="-1">
|
178
|
+
<option name="block-ordinal" value="-1" />
|
179
|
+
</properties>
|
180
|
+
<option name="timeStamp" value="7" />
|
181
|
+
</line-breakpoint>
|
182
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
183
|
+
<url>file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb</url>
|
184
|
+
<line>44</line>
|
185
|
+
<properties myBlockOrdinal="-1">
|
186
|
+
<option name="block-ordinal" value="-1" />
|
187
|
+
</properties>
|
188
|
+
<option name="timeStamp" value="8" />
|
189
|
+
</line-breakpoint>
|
190
|
+
</breakpoints>
|
191
|
+
</breakpoint-manager>
|
192
|
+
</component>
|
193
|
+
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
194
|
+
<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" />
|
195
|
+
<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" />
|
196
|
+
</component>
|
136
197
|
<component name="masterDetails">
|
137
198
|
<states>
|
138
199
|
<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.1)
|
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,43 +1,142 @@
|
|
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
|
|
89
|
+
画像ファイルを適切に処理しブログで使いやすく変換します。
|
90
|
+
|
91
|
+
image1.pngが処理され、image1.jpgが作成されます。
|
92
|
+
|
93
|
+
```
|
94
|
+
imagefilter image1.png
|
95
|
+
```
|
96
|
+
|
97
|
+
内部では以下の処理を順番に実行し、最終的にJPEGファイルを作成します。
|
98
|
+
|
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
|
+
|
26
124
|
### iconcreator
|
27
125
|
|
28
|
-
iconcreator is command line to genelete ios app icons.
|
29
126
|
|
30
|
-
|
127
|
+
オリジナル画像からiOS/macOSアプリ用のアイコンファイルを一気に生成します。リサイズするため、オリジナル画像は1024x1024以上の大きなサイズのものを準備します。
|
128
|
+
|
31
129
|
|
32
130
|
![AppIcon](appicon.png)
|
33
131
|
|
34
132
|
```
|
35
|
-
iconcreator -i
|
133
|
+
iconcreator -t ios -i icon.png -o .
|
36
134
|
```
|
37
135
|
|
38
|
-
|
136
|
+
実行すると、-oで指定した出力フォルダ内にAppIcon.appiconsetフォルダ、および必要なアイコンファイルが出力されます。このフォルダをXcodeプロジェクトのAssets.xcassetsフォル内にコピーします。Assets.xcassets内に存在する既存のAppIcon.appiconsetを起きえます。
|
137
|
+
|
138
|
+
自動的にアプリのアイコンとして認識されるはずです。
|
39
139
|
|
40
|
-
TODO: Write usage instructions here
|
41
140
|
|
42
141
|
|
43
142
|
## 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>
|
@@ -58,7 +58,7 @@ module Imagetools
|
|
58
58
|
end
|
59
59
|
opt.on('-v', '--verbose', 'Verbose message') {|v| opts[:v] = v}
|
60
60
|
types = ['ios', 'mac']
|
61
|
-
opt.on('-t', '--type', types, types.join("|") + "(default ios)") {|v| opts[:t] = v }
|
61
|
+
opt.on('-t', '--type=OSTYPE', types, types.join("|") + "(default ios)") {|v| opts[:t] = v }
|
62
62
|
opt.on('-i INPUTFILE', '--input=INPUTFILE', 'Original icon file(1024x1024 recommended') {|v| opts[:i] = v}
|
63
63
|
opt.on('-o OUTDIR', '--output=OUTDIR', 'Output dir(<PROJECT>/Assets.xcassets or any folder)') {|v| opts[:o] = v}
|
64
64
|
opt.parse!(argv)
|
@@ -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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- src
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03
|
11
|
+
date: 2022-12-03 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.
|