'Get mime-type and format by file extension.
This only accepts "png" or "jpg" or "json".'

def getTypeByExtension(self, extension):

    if (extension.lower() == 'json'):
        return ('application/json', 'JSON')
    elif (extension.lower() == 'png'):
        return ('image/png', 'PNG')
    elif (extension.lower() == 'jpg'):
        return ('image/jpg', 'JPEG')
    else:
        raise KnownUnknown(('MBTiles    only    makes    .png    and    .jpg    and    .json    tiles,    not    "%s"' % extension))
