more changes :3
This commit is contained in:
parent
bb0ec02a53
commit
35d2349ec5
2 changed files with 3 additions and 1 deletions
|
@ -3,3 +3,5 @@ services:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8868:8868"
|
- "8868:8868"
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
|
|
@ -19,7 +19,7 @@ async def root():
|
||||||
async def getImage(request: fastapi.Request):
|
async def getImage(request: fastapi.Request):
|
||||||
img2 = img.copy()
|
img2 = img.copy()
|
||||||
draw = ImageDraw.Draw(img2)
|
draw = ImageDraw.Draw(img2)
|
||||||
draw.text((img2.width/2,img2.height/2), request.client.host, (255,255,255), font=font, stroke_width=5, stroke_fill=(0,0,0), anchor="mm")
|
draw.text((img2.width/2,img2.height/2), request.headers["x-forwarded-for"], (255,255,255), font=font, stroke_width=5, stroke_fill=(0,0,0), anchor="mm")
|
||||||
img_bin = BytesIO()
|
img_bin = BytesIO()
|
||||||
img2.save(img_bin, format="jpeg")
|
img2.save(img_bin, format="jpeg")
|
||||||
return fastapi.Response(content=img_bin.getvalue(), media_type="image/jpeg")
|
return fastapi.Response(content=img_bin.getvalue(), media_type="image/jpeg")
|
||||||
|
|
Loading…
Reference in a new issue