def METHOD_NAME(self, size):
    """Returns (and caches) a scaled pixmap for the image."""
    if self._pixmapsize == size:
        return self._pixmap
    self._pixmap = QPixmap.fromImage(
        self._image.scaled(size, Qt.KeepAspectRatio, Qt.SmoothTransformation))
    self._pixmapsize = size
    return self._pixmap