more changes :3

This commit is contained in:
magmaus3 2023-06-30 15:00:42 +02:00
parent bb0ec02a53
commit 35d2349ec5
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251
2 changed files with 3 additions and 1 deletions

View file

@ -3,3 +3,5 @@ services:
build: .
ports:
- "8868:8868"
volumes:
- .:/app

View file

@ -19,7 +19,7 @@ async def root():
async def getImage(request: fastapi.Request):
img2 = img.copy()
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()
img2.save(img_bin, format="jpeg")
return fastapi.Response(content=img_bin.getvalue(), media_type="image/jpeg")