def METHOD_NAME(
    photo: osxphotos.PhotoInfo,
    preview_path: pathlib.Path,
    export_dir: str,
    directory: str,
    filename_template: str,
    dry_run: bool,
) -> int:
    """Export preview for photo to directory with filename; returns count of images exported"""
    count = 0
    for dirname in get_dirnames_from_template(
        photo=photo,
        directory=directory,
        export_by_date=False,
        dest=export_dir,
        dry_run=dry_run,
    ):
        for filename in get_filenames_from_template(
            photo=photo,
            filename_template=filename_template,
            export_dir=export_dir,
            dest_path=dirname,
            original_name=True,
        ):
            # need to change filename extension to match preview
            filename = pathlib.Path(filename).with_suffix(preview_path.suffix)
            dest_path = pathlib.Path(dirname) / filename
            echo(
                f"Exporting preview for {photo.original_filename} ({photo.uuid}) to {dest_path}"
            )
            if not dry_run:
                try:
                    shutil.copy(preview_path, dest_path)
                except Exception as e:
                    echo_error(f"Error exporting preview: {e}")
                    continue
            count += 1
    return count