size(); $crop = new Rectangle($this->width, $this->height); return $crop->contain( $imagesize->width(), $imagesize->height() )->alignPivotTo($imagesize, $this->position); } /** * @throws RuntimeException */ public function getResizeSize(SizeInterface $size): SizeInterface { return $size->resize($this->width, $this->height); } }