tangstad/helds
tangstad
/
helds
Archived
1
0
Fork 0

Fixed errorhandling/message when no files have been provided.

This commit is contained in:
Truls Alexander Tangstad 2005-11-09 19:10:38 +00:00
parent 5224d67b08
commit a618d6d9f1
1 changed files with 3 additions and 1 deletions

View File

@ -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")