Neos.Media.Browser/Classes/Domain/ImageMapper.php
private function mapCrop(ImageVariant $imageVariant, CropImageAdjustment $adjustment)
    {
        $variantInformation['hasCrop'] = true;
        $variantInformation['cropInformation'] = [
            'width' => $adjustment->getWidth(),
            'height' => $adjustment->getHeight(),
            'x' => $adjustment->getX(),
            'y' => $adjustment->getY(),
        ];

        $aspectRatio = $adjustment->getAspectRatio();
        if ($aspectRatio !== null) {
            [$x, $y, $width, $height] = CropImageAdjustment::calculateDimensionsByAspectRatio($imageVariant->getOriginalAsset()->getWidth(), $imageVariant->getOriginalAsset()->getHeight(), $aspectRatio);
            $variantInformation['cropInformation'] = [
                'width' => $width,
                'height' => $height,
                'x' => $x,
                'y' => $y,
            ];
        }

        return $variantInformation;
    }
private function mapCrop(ImageVariant $imageVariant, CropImageAdjustment $adjustment)
    {
        $variantInformation['hasCrop'] = true;
        $variantInformation['cropInformation'] = [
            'width' => $adjustment->getWidth(),
            'height' => $adjustment->getHeight(),
            'x' => $adjustment->getX(),
            'y' => $adjustment->getY(),
        ];

        $aspectRatio = $adjustment->getAspectRatio();
        if ($aspectRatio !== null) {
            [$x, $y, $width, $height] = CropImageAdjustment::calculateDimensionsByAspectRatio($imageVariant->getOriginalAsset()->getWidth(), $imageVariant->getOriginalAsset()->getHeight(), $aspectRatio);
            $variantInformation['cropInformation'] = [
                'width' => $width,
                'height' => $height,
                'x' => $x,
                'y' => $y,
            ];
        }

        return $variantInformation;
    }
private function mapCrop ( ImageVariant $ imageVariant , CropImageAdjustment $ adjustment ) { $ variantInformation [ 'hasCrop' ] = true ; $ variantInformation [ 'cropInformation' ] = [ 'width' => $ adjustment -> getWidth ( ) , 'height' => $ adjustment -> getHeight ( ) , 'x' => $ adjustment -> getX ( ) , 'y' => $ adjustment -> getY ( ) , ] ; $ aspectRatio = $ adjustment -> getAspectRatio ( ) ; if ( $ aspectRatio !== null ) { [ $ x , $ y , $ width , $ height ] = CropImageAdjustment :: calculateDimensionsByAspectRatio ( $ imageVariant -> getOriginalAsset ( ) -> getWidth ( ) , $ imageVariant -> getOriginalAsset ( ) -> getHeight ( ) , $ aspectRatio ) ; $ variantInformation [ 'cropInformation' ] = [ 'width' => $ width , 'height' => $ height , 'x' => $ x , 'y' => $ y , ] ; } return $ variantInformation ; }
Map crop information for user interface.

@param ImageVariant $imageVariant
@param CropImageAdjustment $adjustment
@return array
Map crop information for user interface .