From 5869505d64c04c536bdcd71a197ade918c36bf1c Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 10 Aug 2014 11:19:38 +0100 Subject: init --- gallery | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 gallery (limited to 'gallery') diff --git a/gallery b/gallery new file mode 100755 index 0000000..e134e23 --- /dev/null +++ b/gallery @@ -0,0 +1,44 @@ +#!/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 '' + print '

Anklicken zum Vergrößern

' + for f in files: + print '
' + print '' + print '
' + print '
' + + + + +if __name__ == '__main__': + main() + -- cgit v1.2.3