#!/usr/bin/env python

import glob, thumb, os
import Image

files=glob.glob("????????.[Jj][Pp][Gg]")
print files

i=file("index.html","w")

for f in files:
  of1=os.path.splitext(f)[0] + "_" + os.path.splitext(f)[1]
  os.system("cp --reply=no %s %s"%(f,of1))
  Image.open(f).save(f, "JPEG")
  of=os.path.splitext(f)[0] + "_t" + os.path.splitext(f)[1]
  thumb.thumb(f,of)
  i.write("<a href=\"%s\"><img src=\"%s\"></a>\n"%(f,of))
  
