How can I guess an image\'s mime type, in a cross-platform manner, and without any external libraries?
If you can rely on the file extension you can use the mimetypes.guess_type function. Note that you may get different results on different platforms, but I would still call it cross-platform.