Neos.Media.Browser/Classes/Controller/AssetController.php
public function variantsAction(string $assetSourceIdentifier, string $assetProxyIdentifier, string $overviewAction): void
    {
        if (!isset($this->assetSources[$assetSourceIdentifier])) {
            throw new \RuntimeException('Given asset source is not configured.', 1509632166);
        }

        $assetSource = $this->assetSources[$assetSourceIdentifier];
        $assetProxyRepository = $assetSource->getAssetProxyRepository();

        try {
            $assetProxy = $assetProxyRepository->getAssetProxy($assetProxyIdentifier);
            $asset = $this->persistenceManager->getObjectByIdentifier($assetProxy->getLocalAssetIdentifier(), Asset::class);

            /** @var VariantSupportInterface $originalAsset */
            $originalAsset = ($asset instanceof AssetVariantInterface ? $asset->getOriginalAsset() : $asset);

            $variantInformation = array_map(static function (AssetVariantInterface $imageVariant) {
                return (new ImageMapper($imageVariant))->getMappingResult();
            }, $originalAsset->getVariants());

            $this->view->assignMultiple([
                'assetProxy' => $assetProxy,
                'asset' => $originalAsset,
                'assetSource' => $assetSource,
                'imageProfiles' => $this->imageProfilesConfiguration,
                'overviewAction' => $overviewAction,
                'originalInformation' => (new ImageMapper($asset))->getMappingResult(),
                'variantsInformation' => $variantInformation
            ]);
        } catch (AssetNotFoundExceptionInterface $e) {
            $this->throwStatus(404, 'Original asset not found');
        } catch (AssetSourceConnectionExceptionInterface $e) {
            $this->view->assign('connectionError', $e);
        }
    }
public function variantsAction(string $assetSourceIdentifier, string $assetProxyIdentifier, string $overviewAction): void
    {
        if (!isset($this->assetSources[$assetSourceIdentifier])) {
            throw new \RuntimeException('Given asset source is not configured.', 1509632166);
        }

        $assetSource = $this->assetSources[$assetSourceIdentifier];
        $assetProxyRepository = $assetSource->getAssetProxyRepository();

        try {
            $assetProxy = $assetProxyRepository->getAssetProxy($assetProxyIdentifier);
            $asset = $this->persistenceManager->getObjectByIdentifier($assetProxy->getLocalAssetIdentifier(), Asset::class);

            /** @var VariantSupportInterface $originalAsset */
            $originalAsset = ($asset instanceof AssetVariantInterface ? $asset->getOriginalAsset() : $asset);

            $variantInformation = array_map(static function (AssetVariantInterface $imageVariant) {
                return (new ImageMapper($imageVariant))->getMappingResult();
            }, $originalAsset->getVariants());

            $this->view->assignMultiple([
                'assetProxy' => $assetProxy,
                'asset' => $originalAsset,
                'assetSource' => $assetSource,
                'imageProfiles' => $this->imageProfilesConfiguration,
                'overviewAction' => $overviewAction,
                'originalInformation' => (new ImageMapper($asset))->getMappingResult(),
                'variantsInformation' => $variantInformation
            ]);
        } catch (AssetNotFoundExceptionInterface $e) {
            $this->throwStatus(404, 'Original asset not found');
        } catch (AssetSourceConnectionExceptionInterface $e) {
            $this->view->assign('connectionError', $e);
        }
    }
public function variantsAction ( string $ assetSourceIdentifier , string $ assetProxyIdentifier , string $ overviewAction ) : void { if ( ! isset ( $ this -> assetSources [ $ assetSourceIdentifier ] ) ) { throw new \ RuntimeException ( 'Given asset source is not configured.' , 1509632166 ) ; } $ assetSource = $ this -> assetSources [ $ assetSourceIdentifier ] ; $ assetProxyRepository = $ assetSource -> getAssetProxyRepository ( ) ; try { $ assetProxy = $ assetProxyRepository -> getAssetProxy ( $ assetProxyIdentifier ) ; $ asset = $ this -> persistenceManager -> getObjectByIdentifier ( $ assetProxy -> getLocalAssetIdentifier ( ) , Asset :: class ) ; /** @var VariantSupportInterface $originalAsset */ $ originalAsset = ( $ asset instanceof AssetVariantInterface ? $ asset -> getOriginalAsset ( ) : $ asset ) ; $ variantInformation = array_map ( static function ( AssetVariantInterface $ imageVariant ) { return ( new ImageMapper ( $ imageVariant ) ) -> getMappingResult ( ) ; } , $ originalAsset -> getVariants ( ) ) ; $ this -> view -> assignMultiple ( [ 'assetProxy' => $ assetProxy , 'asset' => $ originalAsset , 'assetSource' => $ assetSource , 'imageProfiles' => $ this -> imageProfilesConfiguration , 'overviewAction' => $ overviewAction , 'originalInformation' => ( new ImageMapper ( $ asset ) ) -> getMappingResult ( ) , 'variantsInformation' => $ variantInformation ] ) ; } catch ( AssetNotFoundExceptionInterface $ e ) { $ this -> throwStatus ( 404 , 'Original asset not found' ) ; } catch ( AssetSourceConnectionExceptionInterface $ e ) { $ this -> view -> assign ( 'connectionError' , $ e ) ; } }
Display variants of an asset

@param string $assetSourceIdentifier
@param string $assetProxyIdentifier
@param string $overviewAction
@throws StopActionException
@throws UnsupportedRequestTypeException
Display variants of an asset