Neos.Media/Classes/Domain/Model/Adjustment/CropImageAdjustment.php
public function refit(ImageInterface $image): void
    {
        $this->x = 0;
        $this->y = 0;

        $ratio = $this->getWidth() / $image->getWidth();
        $this->setWidth($image->getWidth());
        $this->setHeight($this->getHeight() / $ratio);

        if ($this->getHeight() > $image->getHeight()) {
            $ratio = $this->getHeight() / $image->getHeight();
            $this->setWidth($this->getWidth() / $ratio);
            $this->setHeight($image->getHeight());
        }
    }
public function refit(ImageInterface $image): void
    {
        $this->x = 0;
        $this->y = 0;

        $ratio = $this->getWidth() / $image->getWidth();
        $this->setWidth($image->getWidth());
        $this->setHeight($this->getHeight() / $ratio);

        if ($this->getHeight() > $image->getHeight()) {
            $ratio = $this->getHeight() / $image->getHeight();
            $this->setWidth($this->getWidth() / $ratio);
            $this->setHeight($image->getHeight());
        }
    }
public function refit ( ImageInterface $ image ) : void { $ this -> x = 0 ; $ this -> y = 0 ; $ ratio = $ this -> getWidth ( ) / $ image -> getWidth ( ) ; $ this -> setWidth ( $ image -> getWidth ( ) ) ; $ this -> setHeight ( $ this -> getHeight ( ) / $ ratio ) ; if ( $ this -> getHeight ( ) > $ image -> getHeight ( ) ) { $ ratio = $ this -> getHeight ( ) / $ image -> getHeight ( ) ; $ this -> setWidth ( $ this -> getWidth ( ) / $ ratio ) ; $ this -> setHeight ( $ image -> getHeight ( ) ) ; } }
Refits the crop proportions to be the maximum size within the image boundaries.

@param ImageInterface $image
@return void
Refits the crop proportions to be the maximum size within the image boundaries .