def determine_format(tileSource):
    """
    Given a tile source, return the vendor format.

    :param tileSource: a large_image tile source.
    :returns: the vendor or None if unknown.
    """
    metadata = tileSource.getInternalMetadata() or {}
    if tileSource.name == 'openslide':
        if metadata.get('openslide', {}).get('openslide.vendor') in ('aperio', 'hamamatsu'):
            return metadata['openslide']['openslide.vendor']
    if 'xml' in metadata and any(k.startswith('PIM_DP_') for k in metadata['xml']):
        return 'philips'
    return None