def METHOD_NAME(self, path: str, thumbnail_path: str) -> QPixmap:
    """Create thumbnail for an image.
    Args:
        path: Path to the image for which the thumbnail is created.
        thumbnail_path: Path to which the thumbnail is stored.
    Returns:
        The created QPixmap.
    """
    size = 256 if self._manager.large else 128
    try:
        reader = imagereader.get_reader(path)
        image = reader.get_image(size)
    except ValueError:
        return self._manager.fail_pixmap
    # Image was deleted in the time between reader.read() and now
    try:
        attributes = self._get_thumbnail_attributes(path, image)
    except FileNotFoundError:
        return self._manager.fail_pixmap
    for key, value in attributes.items():
        image.setText(key, value)
    if api.settings.thumbnail.save:
        self._save_thumbnail(image, thumbnail_path)
    return QPixmap(image)