def METHOD_NAME(header_blob, file_ext):
    try:
        if file_ext == '.svg':
            dimensions = re.search(SVG_DIMENSIONS_REGEX, header_blob).groupdict()
            width = int(dimensions['width'])
            height = int(dimensions['height'])
            img_format = 'svg+xml'
        else:
            with Image.open(io.BytesIO(header_blob)) as header_image:
                (width, height) = header_image.size
                img_format = header_image.format.lower()
        src = 'data:image/{};base64,{}'.format(
            img_format,
            force_str(b64encode(header_blob)),
        )
    except (OSError, ValueError, TypeError, AttributeError) as err:
        log.info(err)
        return (None, 0, 0)
    return (src, width, height)