Neos\Media\Domain\Model\ThumbnailGenerator\ImageThumbnailGenerator::refresh PHP Метод

refresh() публичный Метод

public refresh ( Thumbnail $thumbnail ) : void
$thumbnail Neos\Media\Domain\Model\Thumbnail
Результат void
    public function refresh(Thumbnail $thumbnail)
    {
        try {
            $adjustments = array(new ResizeImageAdjustment(array('width' => $thumbnail->getConfigurationValue('width'), 'maximumWidth' => $thumbnail->getConfigurationValue('maximumWidth'), 'height' => $thumbnail->getConfigurationValue('height'), 'maximumHeight' => $thumbnail->getConfigurationValue('maximumHeight'), 'ratioMode' => $thumbnail->getConfigurationValue('ratioMode'), 'allowUpScaling' => $thumbnail->getConfigurationValue('allowUpScaling'))));
            $processedImageInfo = $this->imageService->processImage($thumbnail->getOriginalAsset()->getResource(), $adjustments);
            $thumbnail->setResource($processedImageInfo['resource']);
            $thumbnail->setWidth($processedImageInfo['width']);
            $thumbnail->setHeight($processedImageInfo['height']);
        } catch (\Exception $exception) {
            $message = sprintf('Unable to generate thumbnail for the given image (filename: %s, SHA1: %s)', $thumbnail->getOriginalAsset()->getResource()->getFilename(), $thumbnail->getOriginalAsset()->getResource()->getSha1());
            throw new Exception\NoThumbnailAvailableException($message, 1433109654, $exception);
        }
    }
ImageThumbnailGenerator