diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py new file mode 100644 index 000000000..28d34ca92 --- /dev/null +++ b/examples/upsidedownternet.py @@ -0,0 +1,9 @@ +import Image, cStringIO +def response(context, flow): + if flow.response.headers["content-type"] == ["image/png"]: + s = cStringIO.StringIO(flow.response.content) + img = Image.open(s) + img = img.rotate(180) + s2 = cStringIO.StringIO() + img.save(s2, "png") + flow.response.content = s2.getvalue()