Skip to content

Instantly share code, notes, and snippets.

@kyontan
Created March 4, 2016 09:22
Show Gist options
  • Save kyontan/c2d049e52f82e08b3b08 to your computer and use it in GitHub Desktop.
Save kyontan/c2d049e52f82e08b3b08 to your computer and use it in GitHub Desktop.
画像に隙間を作るやつ
def get_dim(f)
return 2 if f.include?(?2)
return 3 if f.include?(?3)
return 1
end
def gravity(g)
return "west" if g == "l"
return "east"
end
def make_cmd(file, size, g)
"convert -resize 100% -gravity #{gravity(g)} -background transparent -splice #{size*get_dim(file)}x0 #{file} converted/#{file}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment