#!/usr/bin/env python
#--*-- coding:UTF-8 --*--

import os, sys
import Image

size = 80, 80

for infile in sys.argv[1:]:
	outfile = os.path.splitext(infile)[0] + ".thumbnail"
	if infile != outfile:
		try:
			im = Image.open(infile)
			im.thumbnail(size)
			im.save(outfile, "JPEG")
		except IOError:
			print "no puedo crear el thumbnail ", infile
