Hallo Ich habe den folgenden Codereturn GIF-Bild mit Hug API (Bild animiert nicht auf Browser)
@hug.get('/getgif', output=hug.output_format.image('gif'))
def get(username: str, password: str):
dir_path = os.path.dirname(__file__)
img_path = os.path.join(dir_path, 'animation.gif')
img = Image.open(img_path)
return img
Ich bin mit Umarmung, python3 und PIL eine Antwort zu erstellen. Das an meinen Browser zurückgegebene Bild wird überhaupt nicht angezeigt. Ich nehme an, PIL nimmt nur das erste Bild des GIF-Bildes und gibt das zurück. Gibt es eine Alternative, um das gesamte GIF-Bild zurück zum Browser zu streamen?