pillow
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2025-03-12 14:48:40 +01:00
parent 7ff1b70098
commit b3c2c7794a
2 changed files with 17 additions and 1 deletions

View File

@ -38,3 +38,4 @@ tzdata==2025.1
urllib3==2.3.0
Werkzeug==3.1.3
zipp==3.21.0
pillow==11.1.0

View File

@ -1,4 +1,5 @@
from flask import abort
from flask import abort, Response
from PIL import Image, ImageDraw
from app import app
from app import oidc
@ -6,3 +7,17 @@ from app import oidc
@app.route('/')
def index():
abort(404)
@app.route('/generate_image')
def generate_image():
img = Image.new('RGB', (200, 100), color=(255, 255, 255))
draw = ImageDraw.Draw(img)
draw.text((50, 40), "Hello, Flask!", fill=(0, 0, 0)) # Schwarzer Text
img_io = io.BytesIO()
img.save(img_io, 'PNG')
img_io.seek(0) # Zeiger zurücksetzen
return Response(img_io, mimetype='image/png')