Translations:Manual:MIME type detection/21/en

Note that this only works for some well known image types (see $1), other files will be accepted without any additional checks!