this is my code :
import Image,glob
files = glob.glob("/small/*.gif")
for imageFile in files:
print "Processing: " + imageFile
try:
im = Image.open(imageFile)
im.save( "/small_/", "png" )
except Exception as exc:
print "Error: " + str(exc)
but it show error :
File "f.py", line 13
im.save( "/small_/", "png" )
^
SyntaxError: invalid syntax
so what can i do ,
thanks
updated:
import Image,glob,os
files = glob.glob("small/*.gif")
for imageFile in files:
filepath,filename = os.path.split(imageFile)
filterame,exts = os.path.splitext(filename)
print "Processing: " + imageFile,filterame
im = Image.open(imageFile)
im.save( 'small_/'+filterame+'.png','PNG')