def METHOD_NAME(
    clamav_client: clamav.client.ClamAVClient,
    oci_client: oc.Client,
    image_reference: str,
) -> typing.Generator[clamav.model.MalwareScanResult, None, None]:
    start_time = datetime.datetime.now()
    logger.info(f'starting to scan {image_reference=}')
    try:
        content_iterator = iter_image_files(
            image_reference=image_reference,
            oci_client=oci_client,
        )
        findings = clamav_client.scan_container_image(
            content_iterator=content_iterator,
        )
        yield from findings
        passed_seconds = datetime.datetime.now().timestamp() - start_time.timestamp()
        logger.info(f'scan finished for {image_reference=} after {passed_seconds=}')
        return
    except tarfile.TarError as te:
        passed_seconds = datetime.datetime.now().timestamp() - start_time.timestamp()
        logger.warning(f'{image_reference=}: {te=} - falling back to layer-scan {passed_seconds=}')
    # fallback to layer-wise scan in case we encounter gzip-uncompression-problems
    def iter_layers():
        manifest = oci_client.manifest(image_reference=image_reference)
        for layer in manifest.layers:
            layer_blob = oci_client.blob(
                image_reference=image_reference,
                digest=layer.digest,
                stream=True,
            )
            yield (layer_blob.iter_content(chunk_size=4096), layer.digest)
    findings = clamav_client.scan_container_image(
        content_iterator=iter_layers(),
    )
    yield from findings
    passed_seconds = datetime.datetime.now().timestamp() - start_time.timestamp()
    logger.info(f'{image_reference=} layer-scan finished after {passed_seconds=}')