Skip to content

Instantly share code, notes, and snippets.

@harmy
Created March 16, 2012 08:34
Show Gist options
  • Save harmy/2049144 to your computer and use it in GitHub Desktop.
Save harmy/2049144 to your computer and use it in GitHub Desktop.
地图切图脚本
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