imagetools 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +174 -30
- data/Gemfile.lock +4 -4
- data/README.md +8 -2
- data/imagetools.iml +52 -20
- data/lib/imagetools/iconcreator.rb +1 -1
- data/lib/imagetools/imagefilter.rb +96 -53
- data/lib/imagetools/version.rb +1 -1
- metadata +2 -3
- data/.idea/runConfigurations.xml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3b3c82bea2e6142528c1bd2950d328a1a68823f6ae8e0a89f8f69cef33275ed
|
4
|
+
data.tar.gz: e99f4a964370128a821a0b44c170b39d62b7b18078a7122d6f878a7f67f7cab3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4317180125f4d4e31a44666863d40ac2636997ff83211a26bc5e5b99c82e47cc7c5b68a2dff36b94546029fe5a98827ecf14aba4b1c47cb45ee362cdd33243
|
7
|
+
data.tar.gz: e9bba93211d4a035e6bbeabcd41ad7110ff5bcc4b2daad5512bcfe86bb0dcd9e5932f6e5f8915b765e406167b1de1de4eab5677eeedf2ba7ef720fad6914d6f0
|
data/.idea/workspace.xml
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<project version="4">
|
3
|
+
<component name="AutoImportSettings">
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
5
|
+
</component>
|
3
6
|
<component name="ChangeListManager">
|
4
7
|
<list default="true" id="b197c64f-57f8-4389-ab8d-dc9fe3cb05ba" name="Default" comment="">
|
5
|
-
<change beforePath="$PROJECT_DIR$/.idea/
|
8
|
+
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" beforeDir="false" />
|
6
9
|
<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
10
|
<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
11
|
<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
12
|
<change beforePath="$PROJECT_DIR$/lib/imagetools/imagefilter.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/imagetools/imagefilter.rb" afterDir="false" />
|
13
13
|
<change beforePath="$PROJECT_DIR$/lib/imagetools/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/imagetools/version.rb" afterDir="false" />
|
14
|
+
<change beforePath="$PROJECT_DIR$/test/imagefilter_test.rb" beforeDir="false" afterPath="$PROJECT_DIR$/test/imagefilter_test.rb" afterDir="false" />
|
14
15
|
</list>
|
15
16
|
<option name="SHOW_DIALOG" value="false" />
|
16
17
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
@@ -29,10 +30,13 @@
|
|
29
30
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
30
31
|
</component>
|
31
32
|
<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
33
|
<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" />
|
34
|
+
<setting file="file://$PROJECT_DIR$/exe/imageconcat" root0="FORCE_HIGHLIGHTING" />
|
35
35
|
<setting file="file://$PROJECT_DIR$/lib/imagetools/imageconcat.rb" root0="FORCE_HIGHLIGHTING" />
|
36
|
+
<setting file="file://$PROJECT_DIR$/test_imageconcat.sh" root0="FORCE_HIGHLIGHTING" />
|
37
|
+
</component>
|
38
|
+
<component name="MarkdownSettingsMigration">
|
39
|
+
<option name="stateVersion" value="1" />
|
36
40
|
</component>
|
37
41
|
<component name="ProjectFrameBounds">
|
38
42
|
<option name="x" value="254" />
|
@@ -45,27 +49,20 @@
|
|
45
49
|
<option name="hideEmptyMiddlePackages" value="true" />
|
46
50
|
<option name="showLibraryContents" value="true" />
|
47
51
|
</component>
|
48
|
-
<component name="PropertiesComponent">
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
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" />
|
66
|
-
<property name="settings.editor.selected.configurable" value="preferences.keymap" />
|
67
|
-
</component>
|
68
|
-
<component name="RunManager" selected="Ruby.imageconcat">
|
52
|
+
<component name="PropertiesComponent">{
|
53
|
+
"keyToString": {
|
54
|
+
"WebServerToolWindowFactoryState": "false",
|
55
|
+
"node.js.detected.package.eslint": "true",
|
56
|
+
"node.js.detected.package.tslint": "true",
|
57
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
58
|
+
"node.js.selected.package.tslint": "(autodetect)",
|
59
|
+
"nodejs_package_manager_path": "npm",
|
60
|
+
"ruby.rails.projectView.checked": "true",
|
61
|
+
"ruby.structure.view.model.defaults.configured": "true",
|
62
|
+
"vue.rearranger.settings.migration": "true"
|
63
|
+
}
|
64
|
+
}</component>
|
65
|
+
<component name="RunManager" selected="Test::Unit/Shoulda/Minitest.test_replace_image2webp">
|
69
66
|
<configuration default="true" type="Application" factoryName="Application">
|
70
67
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
71
68
|
<method v="2">
|
@@ -86,7 +83,7 @@
|
|
86
83
|
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
87
84
|
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
88
85
|
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
89
|
-
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
86
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
90
87
|
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
91
88
|
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_FORKED_COVERAGE="true">
|
92
89
|
<COVERAGE_PATTERN ENABLED="true">
|
@@ -107,7 +104,7 @@
|
|
107
104
|
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
108
105
|
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
109
106
|
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
110
|
-
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
107
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
111
108
|
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
112
109
|
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_FORKED_COVERAGE="true">
|
113
110
|
<COVERAGE_PATTERN ENABLED="true">
|
@@ -130,6 +127,134 @@
|
|
130
127
|
<option name="Make" enabled="true" />
|
131
128
|
</method>
|
132
129
|
</configuration>
|
130
|
+
<configuration name="test_exclude_image" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
131
|
+
<module name="imagetools" />
|
132
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
133
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
134
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
135
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
136
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
137
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
138
|
+
<envs>
|
139
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
140
|
+
</envs>
|
141
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
142
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
143
|
+
<COVERAGE_PATTERN ENABLED="true">
|
144
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
145
|
+
</COVERAGE_PATTERN>
|
146
|
+
</EXTENSION>
|
147
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
148
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
149
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
150
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
151
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
152
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_exclude_image$" />
|
153
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
154
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
155
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
156
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
157
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
158
|
+
<method v="2">
|
159
|
+
<option name="Make" enabled="true" />
|
160
|
+
</method>
|
161
|
+
</configuration>
|
162
|
+
<configuration name="test_replace_image2webp" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
163
|
+
<module name="imagetools" />
|
164
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
165
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
166
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
167
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
168
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
169
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
170
|
+
<envs>
|
171
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
172
|
+
</envs>
|
173
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
174
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
175
|
+
<COVERAGE_PATTERN ENABLED="true">
|
176
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
177
|
+
</COVERAGE_PATTERN>
|
178
|
+
</EXTENSION>
|
179
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
180
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
181
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
182
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
183
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
184
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_replace_image2webp$" />
|
185
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
186
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
187
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
188
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
189
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
190
|
+
<method v="2">
|
191
|
+
<option name="Make" enabled="true" />
|
192
|
+
</method>
|
193
|
+
</configuration>
|
194
|
+
<configuration name="test_replace_image_filename" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
195
|
+
<module name="imagetools" />
|
196
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
197
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
198
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
199
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
200
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
201
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
202
|
+
<envs>
|
203
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
204
|
+
</envs>
|
205
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
206
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
207
|
+
<COVERAGE_PATTERN ENABLED="true">
|
208
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
209
|
+
</COVERAGE_PATTERN>
|
210
|
+
</EXTENSION>
|
211
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
212
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
213
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
214
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
215
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
216
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_replace_image_filename$" />
|
217
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
218
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
219
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
220
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
221
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
222
|
+
<method v="2">
|
223
|
+
<option name="Make" enabled="true" />
|
224
|
+
</method>
|
225
|
+
</configuration>
|
226
|
+
<configuration name="test_replace_png2jpg" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
227
|
+
<module name="imagetools" />
|
228
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
229
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
230
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$PROJECT_DIR$" />
|
231
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
232
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
233
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
234
|
+
<envs>
|
235
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
236
|
+
</envs>
|
237
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
238
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
239
|
+
<COVERAGE_PATTERN ENABLED="true">
|
240
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
241
|
+
</COVERAGE_PATTERN>
|
242
|
+
</EXTENSION>
|
243
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
244
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
245
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
246
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$PROJECT_DIR$/test/imagefilter_test.rb" />
|
247
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
248
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_replace_png2jpg$" />
|
249
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
250
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
251
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
252
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
253
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
254
|
+
<method v="2">
|
255
|
+
<option name="Make" enabled="true" />
|
256
|
+
</method>
|
257
|
+
</configuration>
|
133
258
|
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
|
134
259
|
<module name="" />
|
135
260
|
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
@@ -142,7 +267,19 @@
|
|
142
267
|
<list>
|
143
268
|
<item itemvalue="Ruby.iconcreator" />
|
144
269
|
<item itemvalue="Ruby.imageconcat" />
|
270
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_exclude_image" />
|
271
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_image2webp" />
|
272
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_image_filename" />
|
273
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_png2jpg" />
|
145
274
|
</list>
|
275
|
+
<recent_temporary>
|
276
|
+
<list>
|
277
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_image2webp" />
|
278
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_exclude_image" />
|
279
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_png2jpg" />
|
280
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_replace_image_filename" />
|
281
|
+
</list>
|
282
|
+
</recent_temporary>
|
146
283
|
</component>
|
147
284
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
148
285
|
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="false" RAILS_SPRING_PRE_LOADER_OPTION="false" />
|
@@ -159,7 +296,10 @@
|
|
159
296
|
<workItem from="1583825074054" duration="96000" />
|
160
297
|
<workItem from="1646719315550" duration="10000" />
|
161
298
|
<workItem from="1669361560975" duration="7318000" />
|
162
|
-
<workItem from="1669384174219" duration="
|
299
|
+
<workItem from="1669384174219" duration="2215000" />
|
300
|
+
<workItem from="1678251388689" duration="1190000" />
|
301
|
+
<workItem from="1682834450840" duration="2235000" />
|
302
|
+
<workItem from="1682836714784" duration="304000" />
|
163
303
|
</task>
|
164
304
|
<servers />
|
165
305
|
</component>
|
@@ -200,6 +340,10 @@
|
|
200
340
|
</component>
|
201
341
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
202
342
|
<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" />
|
343
|
+
<SUITE FILE_PATH="coverage/imagetools@test_replace_image_filename.rcov" NAME="test_replace_image_filename Coverage Results" MODIFIED="1682834940900" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="imagetools" />
|
344
|
+
<SUITE FILE_PATH="coverage/imagetools@test_replace_image2webp.rcov" NAME="test_replace_image2webp Coverage Results" MODIFIED="1682835456004" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="imagetools" />
|
345
|
+
<SUITE FILE_PATH="coverage/imagetools@test_replace_png2jpg.rcov" NAME="test_replace_png2jpg Coverage Results" MODIFIED="1682834990939" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="imagetools" />
|
346
|
+
<SUITE FILE_PATH="coverage/imagetools@test_exclude_image.rcov" NAME="test_exclude_image Coverage Results" MODIFIED="1682835322829" 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
347
|
<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
348
|
</component>
|
205
349
|
<component name="masterDetails">
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
imagetools (1.
|
4
|
+
imagetools (1.7.0)
|
5
5
|
rmagick
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
minitest (5.
|
10
|
+
minitest (5.18.0)
|
11
11
|
pkg-config (1.5.1)
|
12
12
|
rake (13.0.6)
|
13
|
-
rmagick (5.
|
13
|
+
rmagick (5.2.0)
|
14
14
|
pkg-config (~> 1.4)
|
15
15
|
|
16
16
|
PLATFORMS
|
@@ -23,4 +23,4 @@ DEPENDENCIES
|
|
23
23
|
rake (~> 13.0)
|
24
24
|
|
25
25
|
BUNDLED WITH
|
26
|
-
2.
|
26
|
+
2.4.9
|
data/README.md
CHANGED
@@ -123,14 +123,20 @@ Hazelなどの自動化ツールと組みあせると便利です。
|
|
123
123
|
|
124
124
|
### iconcreator
|
125
125
|
|
126
|
-
|
126
|
+
|
127
|
+
オリジナル画像からiOS/macOSアプリ用のアイコンファイルを一気に生成します。リサイズするため、オリジナル画像は1024x1024以上の大きなサイズのものを準備します。
|
128
|
+
|
127
129
|
|
128
130
|
![AppIcon](appicon.png)
|
129
131
|
|
130
132
|
```
|
131
|
-
iconcreator -i
|
133
|
+
iconcreator -t ios -i icon.png -o .
|
132
134
|
```
|
133
135
|
|
136
|
+
実行すると、-oで指定した出力フォルダ内にAppIcon.appiconsetフォルダ、および必要なアイコンファイルが出力されます。このフォルダをXcodeプロジェクトのAssets.xcassetsフォル内にコピーします。Assets.xcassets内に存在する既存のAppIcon.appiconsetを起きえます。
|
137
|
+
|
138
|
+
自動的にアプリのアイコンとして認識されるはずです。
|
139
|
+
|
134
140
|
|
135
141
|
|
136
142
|
## License
|
data/imagetools.iml
CHANGED
@@ -6,21 +6,21 @@
|
|
6
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.18.0)) [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/3.0.0/gems/minitest-5.
|
15
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.
|
14
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.18.0/lib" />
|
15
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.18.0/test" />
|
16
16
|
</CLASSES>
|
17
17
|
<JAVADOC />
|
18
18
|
<SOURCES>
|
19
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.
|
20
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.
|
19
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.18.0/lib" />
|
20
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.18.0/test" />
|
21
21
|
</SOURCES>
|
22
22
|
<excluded>
|
23
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.
|
23
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/minitest-5.18.0/test" />
|
24
24
|
</excluded>
|
25
25
|
</library>
|
26
26
|
</orderEntry>
|
@@ -66,31 +66,63 @@
|
|
66
66
|
</library>
|
67
67
|
</orderEntry>
|
68
68
|
<orderEntry type="module-library">
|
69
|
-
<library name="rmagick (vbundled(5.
|
69
|
+
<library name="rmagick (vbundled(5.2.0)) [path][gem]" type="rubylib">
|
70
70
|
<properties>
|
71
71
|
<option name="version" value="4" />
|
72
72
|
</properties>
|
73
73
|
<CLASSES>
|
74
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
75
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
76
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
77
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
74
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/ext" />
|
75
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/lib" />
|
76
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.github" />
|
77
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.devcontainer" />
|
78
78
|
</CLASSES>
|
79
79
|
<JAVADOC />
|
80
80
|
<SOURCES>
|
81
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
82
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
83
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
84
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
81
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/ext" />
|
82
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/lib" />
|
83
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.github" />
|
84
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.devcontainer" />
|
85
85
|
</SOURCES>
|
86
86
|
<excluded>
|
87
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
88
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
89
|
-
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.
|
87
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/ext" />
|
88
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.github" />
|
89
|
+
<root url="file://$MODULE_DIR$/vendor/bundle/ruby/3.0.0/gems/rmagick-5.2.0/.devcontainer" />
|
90
90
|
</excluded>
|
91
91
|
</library>
|
92
92
|
</orderEntry>
|
93
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.
|
94
|
-
|
93
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.9, rbenv: 3.0.4) [gem]" level="application" />
|
94
|
+
</component>
|
95
|
+
<component name="RakeTasksCache">
|
96
|
+
<option name="myRootTask">
|
97
|
+
<RakeTaskImpl id="rake">
|
98
|
+
<subtasks>
|
99
|
+
<RakeTaskImpl description="Build imagetools-1.7.0.gem into the pkg directory" fullCommand="build" id="build" />
|
100
|
+
<RakeTaskImpl id="build">
|
101
|
+
<subtasks>
|
102
|
+
<RakeTaskImpl description="Generate SHA512 checksum if imagetools-1.7.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
103
|
+
</subtasks>
|
104
|
+
</RakeTaskImpl>
|
105
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
106
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
107
|
+
<RakeTaskImpl description="Build and install imagetools-1.7.0.gem into system gems" fullCommand="install" id="install" />
|
108
|
+
<RakeTaskImpl id="install">
|
109
|
+
<subtasks>
|
110
|
+
<RakeTaskImpl description="Build and install imagetools-1.7.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
111
|
+
</subtasks>
|
112
|
+
</RakeTaskImpl>
|
113
|
+
<RakeTaskImpl description="Create tag v1.7.0 and build and push imagetools-1.7.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
114
|
+
<RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
|
115
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
116
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
117
|
+
<RakeTaskImpl id="release">
|
118
|
+
<subtasks>
|
119
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
120
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
121
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
122
|
+
</subtasks>
|
123
|
+
</RakeTaskImpl>
|
124
|
+
</subtasks>
|
125
|
+
</RakeTaskImpl>
|
126
|
+
</option>
|
95
127
|
</component>
|
96
128
|
</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)
|
@@ -64,13 +64,14 @@ module Imagetools
|
|
64
64
|
|
65
65
|
CONVERT_CMD = "convert"
|
66
66
|
DWEBP_CMD = "dwebp"
|
67
|
+
CWEBP_CMD = "cwebp"
|
67
68
|
RESIZE_CMD = "mogrify -background white -resize %dx\\> "
|
68
69
|
ROTATE_CMD = "exiftran -ai "
|
69
70
|
COMPRESS_CMD = "jpegoptim --strip-all --max=90 "
|
70
|
-
EXTERNAL_CMDS = [CONVERT_CMD, RESIZE_CMD, ROTATE_CMD, COMPRESS_CMD, DWEBP_CMD]
|
71
|
+
EXTERNAL_CMDS = [CONVERT_CMD, RESIZE_CMD, ROTATE_CMD, COMPRESS_CMD, DWEBP_CMD, CWEBP_CMD]
|
71
72
|
|
72
73
|
WEBP_SEARCH = /(.+)\.webp/i
|
73
|
-
WEBP_REPLACE = '\1.
|
74
|
+
WEBP_REPLACE = '\1.webp'
|
74
75
|
|
75
76
|
PNG_SEARCH = /(.+)\.png/i
|
76
77
|
PNG_REPLACE = '\1.jpg'
|
@@ -151,22 +152,35 @@ EOM
|
|
151
152
|
filename.sub(OTHER_JPG_SEARCH, OTHER_JPG_REPLACE)
|
152
153
|
end
|
153
154
|
|
154
|
-
def self.replace_webp2png(filename)
|
155
|
-
filename.sub(WEBP_SEARCH, WEBP_REPLACE)
|
156
|
-
end
|
155
|
+
# def self.replace_webp2png(filename)
|
156
|
+
# filename.sub(WEBP_SEARCH, WEBP_REPLACE)
|
157
|
+
# end
|
157
158
|
|
158
|
-
def self.replace_png2jpg(filename)
|
159
|
-
filename.sub(PNG_SEARCH, PNG_REPLACE)
|
160
|
-
end
|
159
|
+
# def self.replace_png2jpg(filename)
|
160
|
+
# filename.sub(PNG_SEARCH, PNG_REPLACE)
|
161
|
+
# end
|
161
162
|
|
162
163
|
def self.replace_heic2jpg(filename)
|
163
164
|
filename.sub(HEIC_SEARCH, HEIC_REPLACE)
|
164
165
|
end
|
165
166
|
|
167
|
+
def self.replace_image2webp(filename)
|
168
|
+
# PNGとJPGに対応(WEBPはそのまま)
|
169
|
+
str = filename.dup
|
170
|
+
if str.sub!(PNG_SEARCH, WEBP_REPLACE)
|
171
|
+
return str
|
172
|
+
end
|
173
|
+
if str.sub!(JPG_SEARCH, WEBP_REPLACE)
|
174
|
+
return str
|
175
|
+
end
|
176
|
+
return str
|
177
|
+
end
|
178
|
+
|
166
179
|
def self.match_exclude_image?(filename)
|
167
180
|
filename =~ EXCLUDE_PAT
|
168
181
|
end
|
169
182
|
|
183
|
+
|
170
184
|
def self.selftest
|
171
185
|
EXTERNAL_CMDS.each do |cmd|
|
172
186
|
args = cmd.split
|
@@ -193,13 +207,24 @@ EOM
|
|
193
207
|
if exclude_image?(filepath)
|
194
208
|
return
|
195
209
|
end
|
210
|
+
|
211
|
+
# ファイル名変換
|
196
212
|
filepath = rename_image(filepath)
|
197
|
-
|
198
|
-
filepath =
|
199
|
-
filepath =
|
200
|
-
|
213
|
+
|
214
|
+
# filepath = webp2png(filepath)
|
215
|
+
# filepath = png2jpg(filepath)
|
216
|
+
|
217
|
+
# HEICをJPEGに
|
218
|
+
filepath = heic2jpg(filepath)
|
219
|
+
|
220
|
+
# JPEGの回転
|
201
221
|
filepath = rotate_jpg(filepath)
|
202
|
-
|
222
|
+
|
223
|
+
# JPEG/PNG/WEBP 画像のリサイズ
|
224
|
+
filepath = resize_image(filepath)
|
225
|
+
|
226
|
+
# JPEG/PNGをWEBPに変換(WEBPはそのまま)
|
227
|
+
filepath = image2webp(filepath)
|
203
228
|
filepath
|
204
229
|
end
|
205
230
|
|
@@ -228,37 +253,37 @@ EOM
|
|
228
253
|
return topath
|
229
254
|
end
|
230
255
|
|
231
|
-
def webp2png(filepath)
|
232
|
-
|
233
|
-
|
234
|
-
|
256
|
+
# def webp2png(filepath)
|
257
|
+
# fromname = File.basename(filepath)
|
258
|
+
# toname = self.class.replace_webp2png(fromname)
|
259
|
+
# return filepath if fromname == toname
|
235
260
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
end
|
261
|
+
# dir = File.dirname(filepath)
|
262
|
+
# topath = File.join(dir, toname)
|
263
|
+
# puts "convert: #{filepath} => #{topath}"
|
264
|
+
# # dwebp ~/Desktop/1.webp -o ~/Desktop/1.jpg
|
265
|
+
# cmd = "#{DWEBP_CMD} \"#{filepath}\" -o \"#{topath}\""
|
266
|
+
# if system(cmd)
|
267
|
+
# FileUtils.rm(filepath)
|
268
|
+
# end
|
269
|
+
# return topath
|
270
|
+
# end
|
246
271
|
|
247
|
-
def png2jpg(filepath)
|
248
|
-
|
249
|
-
|
250
|
-
|
272
|
+
# def png2jpg(filepath)
|
273
|
+
# fromname = File.basename(filepath)
|
274
|
+
# toname = self.class.replace_png2jpg(fromname)
|
275
|
+
# return filepath if fromname == toname
|
251
276
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
end
|
277
|
+
# dir = File.dirname(filepath)
|
278
|
+
# topath = File.join(dir, toname)
|
279
|
+
# puts "convert: #{filepath} => #{topath}"
|
280
|
+
# # convert test.png -background "#ffff00" -flatten test.jpg
|
281
|
+
# cmd = "#{CONVERT_CMD} \"#{filepath}\" -background \"#ffffff\" -flatten \"#{topath}\""
|
282
|
+
# if system(cmd)
|
283
|
+
# FileUtils.rm(filepath)
|
284
|
+
# end
|
285
|
+
# return topath
|
286
|
+
# end
|
262
287
|
|
263
288
|
def heic2jpg(filepath)
|
264
289
|
fromname = File.basename(filepath)
|
@@ -277,9 +302,11 @@ EOM
|
|
277
302
|
return topath
|
278
303
|
end
|
279
304
|
|
280
|
-
def
|
305
|
+
def resize_image(filepath)
|
281
306
|
fromname = File.basename(filepath)
|
282
|
-
|
307
|
+
# .JPEG .PNG .WEBPを許す
|
308
|
+
is_image = (fromname =~ JPG_SEARCH || fromname =~ PNG_SEARCH || fromname =~ WEBP_SEARCH)
|
309
|
+
unless is_image
|
283
310
|
return filepath
|
284
311
|
end
|
285
312
|
puts "resize: #{filepath}"
|
@@ -300,15 +327,31 @@ EOM
|
|
300
327
|
return filepath
|
301
328
|
end
|
302
329
|
|
303
|
-
def compress_jpg(filepath)
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
end
|
330
|
+
# def compress_jpg(filepath)
|
331
|
+
# fromname = File.basename(filepath)
|
332
|
+
# unless fromname =~ JPG_SEARCH
|
333
|
+
# return filepath
|
334
|
+
# end
|
335
|
+
# puts "compress: #{filepath}"
|
336
|
+
# cmd = "#{COMPRESS_CMD} \"#{filepath}\""
|
337
|
+
# system(cmd)
|
338
|
+
# return filepath
|
339
|
+
# end
|
340
|
+
|
341
|
+
def image2webp(filepath)
|
342
|
+
fromname = File.basename(filepath)
|
343
|
+
toname = self.class.replace_image2webp(fromname)
|
344
|
+
return filepath if fromname == toname
|
345
|
+
dir = File.dirname(filepath)
|
346
|
+
topath = File.join(dir, toname)
|
347
|
+
puts "image2webp: #{filepath} => #{topath}"
|
348
|
+
# cwebp ~/Desktop/1.webp -o ~/Desktop/1.jpg
|
349
|
+
cmd = "#{CWEBP_CMD} -quiet \"#{filepath}\" -o \"#{topath}\""
|
350
|
+
# puts cmd
|
351
|
+
if system(cmd)
|
352
|
+
FileUtils.rm(filepath)
|
353
|
+
end
|
354
|
+
return topath
|
355
|
+
end
|
313
356
|
end
|
314
357
|
end
|
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.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:
|
11
|
+
date: 2023-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|
@@ -87,7 +87,6 @@ files:
|
|
87
87
|
- ".idea/inspectionProfiles/Project_Default.xml"
|
88
88
|
- ".idea/misc.xml"
|
89
89
|
- ".idea/modules.xml"
|
90
|
-
- ".idea/runConfigurations.xml"
|
91
90
|
- ".idea/vcs.xml"
|
92
91
|
- ".idea/workspace.xml"
|
93
92
|
- ".ruby-version"
|
data/.idea/runConfigurations.xml
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="RunConfigurationProducerService">
|
4
|
-
<option name="ignoredProducers">
|
5
|
-
<set>
|
6
|
-
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
7
|
-
</set>
|
8
|
-
</option>
|
9
|
-
</component>
|
10
|
-
</project>
|