#!/usr/bin/env python # -*- coding: utf-8 -*- """ gallery make a nice little web gallery Patrick Simianer
2010-03-31 """ import sys, os, glob, subprocess, shlex def main(): try: path = sys.argv[1] except IndexError: print 'Usage: gallery.py /path/to/images/' sys.exit(1) path += '/' files = glob.glob(path+'*.jpg') if not os.path.exists(path+'thumbs'): os.mkdir(path+'thumbs') files.sort() for f in files: cmd = 'convert "'+f+'" -resize 320x320 "'+path+'thumbs/'+f.split('/')[-1]+'"' a = shlex.split(cmd) subprocess.Popen(a) print '