add strict mode for magic type, use file extension by default.