projekty
/
imago.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3fa4920
)
multiple images
author
Tomas Musil
<tomik.musil@gmail.com>
Sat, 13 Oct 2012 15:43:09 +0000
(17:43 +0200)
committer
Tomas Musil
<tomik.musil@gmail.com>
Sat, 13 Oct 2012 15:43:09 +0000
(17:43 +0200)
imago.py
patch
|
blob
|
history
diff --git
a/imago.py
b/imago.py
index
a0eabfd
..
c053a7f
100755
(executable)
--- a/
imago.py
+++ b/
imago.py
@@
-22,7
+22,7
@@
def main():
"""Main function of the program."""
parser = argparse.ArgumentParser(description=__doc__)
"""Main function of the program."""
parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('file
', metavar='file', nargs=1
,
+ parser.add_argument('file
s', metavar='file', nargs='+'
,
help="image to analyse")
parser.add_argument('-w', type=int, default=640,
help="scale image to the specified width before analysis")
help="image to analyse")
parser.add_argument('-w', type=int, default=640,
help="scale image to the specified width before analysis")
@@
-40,7
+40,7
@@
def main():
verbose = args.verbose
try:
verbose = args.verbose
try:
- image = Image.open(args.file[0])
+ image = Image.open(args.file
s
[0])
except IOError, msg:
print >> sys.stderr, msg
return 1
except IOError, msg:
print >> sys.stderr, msg
return 1
@@
-69,6
+69,19
@@
def main():
#simple ASCII output:
for line in board:
print ' '.join(line)
#simple ASCII output:
for line in board:
print ' '.join(line)
+
+ if len(args.files) > 1:
+ for f in args.files[1:]:
+ try:
+ image = Image.open(f)
+ except IOError, msg:
+ print >> sys.stderr, msg
+ continue
+ if image.mode == 'P':
+ image = image.convert('RGB')
+ board = intrsc.board(image, lines, show_all, do_something)
+ for line in board:
+ print ' '.join(line)
return 0
return 0