Open Desour opened 3 months ago
https://docs.python.org/3/library/imghdr.html
imghdr
is deprecated. Maybe filetype
is a viable alternative.
If I open it in GIMP and re-export it again, it works. So something is odd with the encoding that imghdr can't recognise
CDB already depends on Pillow, I'm sure it can determine the image type.
At the very least, the error message should be fixed. Something like: "This is either not an image or this image format is not supported by ContentDB.".
Summary
I'm trying to upload screenshots as jpg, by converting them from png with ffmeg. But contentdb fails to recognize them as image.
Steps to reproduce
default_lava.png
from devtest)ffmpeg -i input_file output_file
Uploaded image isn't actually an image
Here's an example, it's clearly a jpeg image, just ask
file
:And it is, in fact, an image. Stop gaslighting me!
Relevant code, probably
https://github.com/minetest/contentdb/blob/master/app/logic/uploads.py