Created
May 21, 2012 05:38
-
-
Save venj/2760670 to your computer and use it in GitHub Desktop.
batch convert images for appstore for my project.
This file contains 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
#!/usr/bin/env ruby | |
require "fileutils" | |
include FileUtils | |
p = "processed" | |
mkdir "processed" unless File.exists?(p) | |
Dir["*.png"].each do |f| | |
puts "Processing #{f}." | |
name = File.basename(f).split('.')[0] | |
cp f, "#{p}/#{name}@2x.png" | |
system("convert -resize 96x96 #{f} #{p}/#{name}[email protected]") | |
system("convert -resize 64x64 #{f} #{p}/#{name}.png") | |
system("convert -resize 48x48 #{f} #{p}/#{name}_small.png") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment