2011-08-26 07:01:33 +00:00
|
|
|
import Image, cStringIO
|
|
|
|
def response(context, flow):
|
|
|
|
if flow.response.headers["content-type"] == ["image/png"]:
|
|
|
|
s = cStringIO.StringIO(flow.response.content)
|
2011-08-26 21:24:04 +00:00
|
|
|
img = Image.open(s).rotate(180)
|
2011-08-26 07:01:33 +00:00
|
|
|
s2 = cStringIO.StringIO()
|
|
|
|
img.save(s2, "png")
|
|
|
|
flow.response.content = s2.getvalue()
|