Created
December 14, 2013 02:18
-
-
Save keimina/7954912 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
from PIL import Image | |
import os | |
filelist = ['foo.jpg', 'bar.bmp', 'zot.png'] | |
for infile in filelist: | |
outfile = os.path.splitext(infile)[0] + ".jpg" | |
if infile != outfile: | |
try: | |
Image.open(infile).save(outfile) | |
except IOError: | |
print "cannot convert", infile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment