aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lufa/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj
diff options
context:
space:
mode:
authorKeLorean <regor2526@gmail.com>2018-06-04 11:11:17 -0400
committerDrashna Jaelre <drashna@live.com>2018-06-04 08:11:17 -0700
commitb05c15363326e3d79b5effcd0135e825de6553c6 (patch)
tree09e382968b1c28b3b637835100370d281cbcddf8 /lib/lufa/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj
parent5229734647706054066c277ea348a6d25cc38095 (diff)
downloadfirmware-b05c15363326e3d79b5effcd0135e825de6553c6.tar.gz
firmware-b05c15363326e3d79b5effcd0135e825de6553c6.tar.bz2
firmware-b05c15363326e3d79b5effcd0135e825de6553c6.zip
change to ca66 kelorean layout (#3116)
Diffstat (limited to 'lib/lufa/Projects/LEDNotifier/CPUUsageApp/CPUMonitor.csproj')
0 files changed, 0 insertions, 0 deletions
color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
"""
This script rotates all images passing through the proxy by 180 degrees.
"""
import io
from PIL import Image
from mitmproxy import http


def response(flow: http.HTTPFlow) -> None:
    if flow.response.headers.get("content-type", "").startswith("image"):
        s = io.BytesIO(flow.response.content)
        img = Image.open(s).rotate(180)
        s2 = io.BytesIO()
        img.save(s2, "png")
        flow.response.content = s2.getvalue()
        flow.response.headers["content-type"] = "image/png"