def get_comic_format(filename):
    """Return the comic format if it is a comic archive."""
    image_format = None
    filename_ext = os.path.splitext(filename)[-1].lower()
    if filename_ext in _COMIC_EXTS:
        if zipfile.is_zipfile(filename):
            image_format = _CBZ_FORMAT
        elif rarfile.is_rarfile(filename):
            image_format = _CBR_FORMAT
    return image_format
Return the comic format if it is a comic archive.