Fixed errorhandling/message when no files have been provided.
This commit is contained in:
parent
5224d67b08
commit
a618d6d9f1
|
@ -1,12 +1,14 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
"""Convert image to raw binary using Python Imaging Library."""
|
"""Convert image to raw binary using Python Imaging Library."""
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
print "Usage: %s <source> <target>"
|
print "Usage: %s <source> <target>" % os.path.split(sys.argv[0])[1]
|
||||||
print "WARNING: It only converts 8x8 pixel images at 8bit the moment."
|
print "WARNING: It only converts 8x8 pixel images at 8bit the moment."
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
im = Image.open(sys.argv[1])
|
im = Image.open(sys.argv[1])
|
||||||
output = open(sys.argv[2], "wb")
|
output = open(sys.argv[2], "wb")
|
||||||
|
|
Reference in New Issue