WebP is probably being generated with the wrong mime
Helvio88 opened this issue · 6 comments
Please try to open:
https://api.memegen.link/images/buzz/memes/memes_everywhere.webp
You'd get the binary data.
It worked on the Heroku app and also works on Docker. Must be a webserver/proxy issue.
Uncomment these lines when the bug is fixed:
memegen/app/tests/test_views_images.py
Lines 151 to 155 in 9307cc4
Yeah, the browser console says this is being returned as text/plain
. The image does display correctly in Slack. 🤔
I see that the second loop wasn't necessary. Go figure. I could have swore I tried that before! Thanks for pointing that out!
Yeah, potentially the extension could be passed in to update this line but I don't think wrapping the frames
in Image
was doing anything.
This seems to be the root cause: https://bugs.python.org/issue38902
I'll try hard-coding image/webp
for now.
That's crazy. Funny how it worked on Docker. I hope they fix that soon.
It sounds like the database of file types might vary slightly between distributions of Python, so I guess Heroku's Python is missing the webp
support.