MCPcopy Create free account
hub / github.com/ActiveState/code / save

Function save

recipes/Python/577886_Convert_Image_Format/recipe-577886.py:53–61  ·  view source on GitHub ↗
(infile, outfile)

Source from the content-addressed store, hash-verified

51 outdir = os.path.dirname(outfile)
52
53def save(infile, outfile):
54 # should maybe treat transparency apart for some image format ?
55 if infile != outfile:
56 try:
57 Image.open(infile).save(outfile)
58 return True
59 except IOError:
60 print "Cannot convert", infile
61 return False
62
63def selector():
64 path, file = os.path.split(openfile)

Callers 1

convertFunction · 0.70

Calls 2

saveMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected