PHP Class Neos\Media\Domain\Service\ThumbnailService

Note that this repository is not part of the public API. Use the asset's getThumbnail() method instead.
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$imageService ImageService
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$presets boolean
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$thumbnailCache array
$thumbnailRepository Neos\Media\Domain\Repository\ThumbnailRepository

Public Methods

Method Description
getPresets ( ) : array
getThumbnail ( Neos\Media\Domain\Model\AssetInterface $asset, ThumbnailConfiguration $configuration ) : Neos\Media\Domain\Model\ImageInterface Returns a thumbnail of the given asset
getThumbnailConfigurationForPreset ( string $preset, boolean $async = false ) : ThumbnailConfiguration
getUriForThumbnail ( Neos\Media\Domain\Model\ImageInterface $thumbnail ) : string
refreshThumbnail ( Thumbnail $thumbnail ) : void Refreshes a thumbnail and persists the thumbnail

Protected Methods

Method Description
emitThumbnailCreated ( Thumbnail $thumbnail ) : void Signals that a thumbnail was created.

Method Details

emitThumbnailCreated() protected method

Signals that a thumbnail was created.
protected emitThumbnailCreated ( Thumbnail $thumbnail ) : void
$thumbnail Neos\Media\Domain\Model\Thumbnail
return void

getPresets() public method

public getPresets ( ) : array
return array Returns preset configuration for all presets

getThumbnail() public method

If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of the original asset is used.
public getThumbnail ( Neos\Media\Domain\Model\AssetInterface $asset, ThumbnailConfiguration $configuration ) : Neos\Media\Domain\Model\ImageInterface
$asset Neos\Media\Domain\Model\AssetInterface The asset to render a thumbnail for
$configuration Neos\Media\Domain\Model\ThumbnailConfiguration
return Neos\Media\Domain\Model\ImageInterface

getThumbnailConfigurationForPreset() public method

public getThumbnailConfigurationForPreset ( string $preset, boolean $async = false ) : ThumbnailConfiguration
$preset string The preset identifier
$async boolean
return Neos\Media\Domain\Model\ThumbnailConfiguration

getUriForThumbnail() public method

public getUriForThumbnail ( Neos\Media\Domain\Model\ImageInterface $thumbnail ) : string
$thumbnail Neos\Media\Domain\Model\ImageInterface
return string

refreshThumbnail() public method

Refreshes a thumbnail and persists the thumbnail
public refreshThumbnail ( Thumbnail $thumbnail ) : void
$thumbnail Neos\Media\Domain\Model\Thumbnail
return void

Property Details

$imageService protected property

protected ImageService,Neos\Media\Domain\Service $imageService
return ImageService

$persistenceManager protected property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$presets protected property

protected bool $presets
return boolean

$resourceManager protected property

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
return Neos\Flow\ResourceManagement\ResourceManager

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface

$thumbnailCache protected property

protected array $thumbnailCache
return array

$thumbnailRepository protected property

protected ThumbnailRepository,Neos\Media\Domain\Repository $thumbnailRepository
return Neos\Media\Domain\Repository\ThumbnailRepository