mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-12-24 13:33:00 +00:00
Lena-Bilder
This commit is contained in:
parent
0e792d4304
commit
d13006ce95
3 changed files with 9 additions and 3 deletions
|
@ -64,7 +64,7 @@ async def load_picture_standard() -> Image.Image:
|
|||
"""
|
||||
|
||||
# Bild laden
|
||||
img = Image.open("hand.png")
|
||||
img = Image.open("lena2.jpg")
|
||||
|
||||
# Größen bestimmen
|
||||
width, height = img.size
|
||||
|
@ -189,10 +189,10 @@ async def get_picture_for_day(
|
|||
|
||||
# Bilddaten in Puffer laden
|
||||
img_buffer = BytesIO()
|
||||
img.save(img_buffer, format="PNG", quality=85)
|
||||
img.save(img_buffer, format="JPEG", quality=85)
|
||||
img_buffer.seek(0)
|
||||
|
||||
return StreamingResponse(
|
||||
content=img_buffer,
|
||||
media_type="image/png",
|
||||
media_type="image/jpg",
|
||||
)
|
||||
|
|
BIN
api/lena.jpg
(Stored with Git LFS)
Normal file
BIN
api/lena.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
api/lena2.jpg
(Stored with Git LFS)
Normal file
BIN
api/lena2.jpg
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in a new issue