def valid_image_file_odl(file_obj): res = imghdr.what('ignored.txt', h=file_obj.read()) return res in ALLOWED_EXTENSIONS