Created
May 6, 2014 12:26
-
-
Save esetomo/220897abf23c1179ea0e to your computer and use it in GitHub Desktop.
Inkscapeでsvgファイルが保存されたら各サイズのアイコンPNGファイルを生成
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard :shell do | |
watch(%r{(.+)\.svg}) do |m| | |
%w(Small 40 60 76).each do |size| | |
['', '@2x'].each do |scale| | |
width = size.to_i | |
width = 32 if width == 0 | |
width *= 2 if scale == '@2x' | |
system("inkscape #{m[0]} --export-png=#{m[1]}-#{size}#{scale}.png --export-area-page --export-width=#{width}") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment