Open Desour opened 1 month 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.
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