Neos.Media/Classes/Domain/Service/AssetService.php
public function getThumbnailUriAndSizeForAsset(AssetInterface $asset, ThumbnailConfiguration $configuration, ActionRequest $request = null)
    {
        $thumbnailImage = $this->thumbnailService->getThumbnail($asset, $configuration);
        if (!$thumbnailImage instanceof ImageInterface) {
            return null;
        }
        $resource = $thumbnailImage->getResource();
        if ($thumbnailImage instanceof Thumbnail) {
            $staticResource = $thumbnailImage->getStaticResource();
            if ($configuration->isAsync() === true && $resource === null && $staticResource === null) {
                if ($request === null) {
                    throw new AssetServiceException('Request argument must be provided for async thumbnails.', 1447660835);
                }
                $this->uriBuilder->setRequest($request->getMainRequest());
                $uri = $this->uriBuilder
                    ->reset()
                    ->setCreateAbsoluteUri(true)
                    ->uriFor('thumbnail', ['thumbnail' => $thumbnailImage], 'Thumbnail', 'Neos.Media');
            } else {
                $uri = $this->thumbnailService->getUriForThumbnail($thumbnailImage);
            }
        } else {
            $uri = $this->resourceManager->getPublicPersistentResourceUri($resource);
        }

        return [
            'width' => $thumbnailImage->getWidth(),
            'height' => $thumbnailImage->getHeight(),
            'src' => $uri
        ];
    }
public function getThumbnailUriAndSizeForAsset(AssetInterface $asset, ThumbnailConfiguration $configuration, ActionRequest $request = null)
    {
        $thumbnailImage = $this->thumbnailService->getThumbnail($asset, $configuration);
        if (!$thumbnailImage instanceof ImageInterface) {
            return null;
        }
        $resource = $thumbnailImage->getResource();
        if ($thumbnailImage instanceof Thumbnail) {
            $staticResource = $thumbnailImage->getStaticResource();
            if ($configuration->isAsync() === true && $resource === null && $staticResource === null) {
                if ($request === null) {
                    throw new AssetServiceException('Request argument must be provided for async thumbnails.', 1447660835);
                }
                $this->uriBuilder->setRequest($request->getMainRequest());
                $uri = $this->uriBuilder
                    ->reset()
                    ->setCreateAbsoluteUri(true)
                    ->uriFor('thumbnail', ['thumbnail' => $thumbnailImage], 'Thumbnail', 'Neos.Media');
            } else {
                $uri = $this->thumbnailService->getUriForThumbnail($thumbnailImage);
            }
        } else {
            $uri = $this->resourceManager->getPublicPersistentResourceUri($resource);
        }

        return [
            'width' => $thumbnailImage->getWidth(),
            'height' => $thumbnailImage->getHeight(),
            'src' => $uri
        ];
    }
public function getThumbnailUriAndSizeForAsset ( AssetInterface $ asset , ThumbnailConfiguration $ configuration , ActionRequest $ request = null ) { $ thumbnailImage = $ this -> thumbnailService -> getThumbnail ( $ asset , $ configuration ) ; if ( ! $ thumbnailImage instanceof ImageInterface ) { return null ; } $ resource = $ thumbnailImage -> getResource ( ) ; if ( $ thumbnailImage instanceof Thumbnail ) { $ staticResource = $ thumbnailImage -> getStaticResource ( ) ; if ( $ configuration -> isAsync ( ) === true && $ resource === null && $ staticResource === null ) { if ( $ request === null ) { throw new AssetServiceException ( 'Request argument must be provided for async thumbnails.' , 1447660835 ) ; } $ this -> uriBuilder -> setRequest ( $ request -> getMainRequest ( ) ) ; $ uri = $ this -> uriBuilder -> reset ( ) -> setCreateAbsoluteUri ( true ) -> uriFor ( 'thumbnail' , [ 'thumbnail' => $ thumbnailImage ] , 'Thumbnail' , 'Neos.Media' ) ; } else { $ uri = $ this -> thumbnailService -> getUriForThumbnail ( $ thumbnailImage ) ; } } else { $ uri = $ this -> resourceManager -> getPublicPersistentResourceUri ( $ resource ) ; } return [ 'width' => $ thumbnailImage -> getWidth ( ) , 'height' => $ thumbnailImage -> getHeight ( ) , 'src' => $ uri ] ; }
Calculates the dimensions of the thumbnail to be generated and returns the thumbnail URI.
In case of Images this is a thumbnail of the image, in case of other assets an icon representation.

@param AssetInterface $asset
@param ThumbnailConfiguration $configuration
@param ActionRequest $request Request argument must be provided for asynchronous thumbnails
@return array|null Array with keys "width", "height" and "src" if the thumbnail generation work or null
@throws AssetServiceException
@throws ThumbnailServiceException
@throws MissingActionNameException
Calculates the dimensions of the thumbnail to be generated and returns the thumbnail URI . In case of Images this is a thumbnail of the image in case of other assets an icon representation .