diff --git a/src/PIL/IcnsImagePlugin.py b/src/PIL/IcnsImagePlugin.py index 21fd558f2..7c1bd5882 100644 --- a/src/PIL/IcnsImagePlugin.py +++ b/src/PIL/IcnsImagePlugin.py @@ -353,6 +353,11 @@ if sys.platform == 'darwin': if __name__ == '__main__': + + if len(sys.argv) < 2: + print("Syntax: python IcnsImagePlugin.py [file]") + sys.exit() + imf = IcnsImageFile(open(sys.argv[1], 'rb')) for size in imf.info['sizes']: imf.size = size diff --git a/src/PIL/ImageShow.py b/src/PIL/ImageShow.py index bf8c67eb5..fdd739920 100644 --- a/src/PIL/ImageShow.py +++ b/src/PIL/ImageShow.py @@ -186,5 +186,9 @@ else: register(XVViewer) if __name__ == "__main__": - # usage: python ImageShow.py imagefile [title] + + if len(sys.argv) < 2: + print("Syntax: python ImageShow.py imagefile [title]") + sys.exit() + print(show(Image.open(sys.argv[1]), *sys.argv[2:]))