mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Merge pull request #4425 from radarhere/icns_fp
Fix saving bug in IcnsImagePlugin __main__
This commit is contained in:
commit
53ece804c7
|
@ -365,13 +365,12 @@ if __name__ == "__main__":
|
|||
print("Syntax: python IcnsImagePlugin.py [file]")
|
||||
sys.exit()
|
||||
|
||||
imf = IcnsImageFile(open(sys.argv[1], "rb"))
|
||||
for size in imf.info["sizes"]:
|
||||
imf.size = size
|
||||
imf.load()
|
||||
im = imf.im
|
||||
im.save("out-%s-%s-%s.png" % size)
|
||||
im = Image.open(sys.argv[1])
|
||||
im.save("out.png")
|
||||
if sys.platform == "windows":
|
||||
os.startfile("out.png")
|
||||
with open(sys.argv[1], "rb") as fp:
|
||||
imf = IcnsImageFile(fp)
|
||||
for size in imf.info["sizes"]:
|
||||
imf.size = size
|
||||
imf.save("out-%s-%s-%s.png" % size)
|
||||
im = Image.open(sys.argv[1])
|
||||
im.save("out.png")
|
||||
if sys.platform == "windows":
|
||||
os.startfile("out.png")
|
||||
|
|
Loading…
Reference in New Issue
Block a user