Logo white

Peter M. Groen / openbr

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • openbr
  • scripts
  • imagesToHtml.py
  • Simple script to convert view a directory of images in html form
    587f466c
    Brendan K authored
    2015-11-09 17:40:23 -0500  
    Browse Code ยป
imagesToHtml.py 363 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/bin/python 

import sys
import glob
import os

assert(len(sys.argv) > 1)

inputDir = sys.argv[1]
if len(sys.argv) > 2:
    imgSize = int(sys.argv[2])
else:
    imgSize = 128

out = open('images.html','w')
imgs = glob.glob(os.path.join(inputDir, '*.jpg'))
imgs.sort()
for i in imgs:
    print >> out, '<img src="%s" height="%d" />' % (i, imgSize)
out.close()