Commit 587f466c8754ca6000c5a4b2db09e1ffade042dd
1 parent
b77220f8
Simple script to convert view a directory of images in html form
Showing
1 changed file
with
22 additions
and
0 deletions
scripts/imagesToHtml.py
0 → 100644
| 1 | +#!/bin/python | ||
| 2 | + | ||
| 3 | +import sys | ||
| 4 | +import glob | ||
| 5 | +import os | ||
| 6 | + | ||
| 7 | +assert(len(sys.argv) > 1) | ||
| 8 | + | ||
| 9 | +inputDir = sys.argv[1] | ||
| 10 | +if len(sys.argv) > 2: | ||
| 11 | + imgSize = int(sys.argv[2]) | ||
| 12 | +else: | ||
| 13 | + imgSize = 128 | ||
| 14 | + | ||
| 15 | +out = open('images.html','w') | ||
| 16 | +imgs = glob.glob(os.path.join(inputDir, '*.jpg')) | ||
| 17 | +imgs.sort() | ||
| 18 | +for i in imgs: | ||
| 19 | + print >> out, '<img src="%s" height="%d" />' % (i, imgSize) | ||
| 20 | +out.close() | ||
| 21 | + | ||
| 22 | + |