#!/usr/bin/env python # # (C) 2002 Markku Hänninen (hmm@iki.fi) # import sys, os, tempfile, shutil def runprog(command): p = os.popen(command, 'r') s = p.read() ret = p.close() return s def rotatepic(pic, degree): tmpfile = tempfile.mktemp() runprog("jpegtran -rotate %d -outfile %s %s" % (degree, tmpfile, pic)) shutil.copyfile(tmpfile, pic) os.unlink(tmpfile) for p in sys.argv[1:]: rotatepic(p, 270)