Created
March 16, 2012 08:34
-
-
Save harmy/2049144 to your computer and use it in GitHub Desktop.
地图切图脚本
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
import os, shutil, glob | |
for file in glob.glob("*.jpg"): | |
print "processing %s..." % file | |
try: | |
shutil.rmtree(file[:-4]) | |
except: | |
pass | |
os.mkdir(file[:-4]) | |
os.system("convert.exe -crop 512x512 -quality 75%% -scene 1 %s %s\%%d.jpg" % (file, file[:-4])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment