PHP Class Neos\Media\Domain\Service\ImageService

Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$assetRepository Neos\Media\Domain\Repository\AssetRepository
$environment Neos\Flow\Utility\Environment
$imageSizeCache Neos\Cache\Frontend\VariableFrontend
$imagineService Imagine\Image\ImagineInterface
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$settings array

Public Methods

Method Description
getImageSize ( PersistentResource $resource ) : array Get the size of a Flow PersistentResource that contains an image file.
injectSettings ( array $settings ) : void
processImage ( PersistentResource $originalResource, array $adjustments ) : array

Protected Methods

Method Description
applyAdjustments ( Imagine\Image\ImageInterface $image, array $adjustments, boolean &$adjustmentsApplied ) : Imagine\Image\ImageInterface
getOptionsMergedWithDefaults ( array $additionalOptions = [] ) : array
isAnimatedGif ( string $image ) : boolean Detects whether the given GIF image data contains more than one frame

Method Details

applyAdjustments() protected method

protected applyAdjustments ( Imagine\Image\ImageInterface $image, array $adjustments, boolean &$adjustmentsApplied ) : Imagine\Image\ImageInterface
$image Imagine\Image\ImageInterface
$adjustments array Ordered list of adjustments to apply.
$adjustmentsApplied boolean Reference to a variable that will hold information if an adjustment was actually applied.
return Imagine\Image\ImageInterface

getImageSize() public method

Get the size of a Flow PersistentResource that contains an image file.
public getImageSize ( PersistentResource $resource ) : array
$resource Neos\Flow\ResourceManagement\PersistentResource
return array width and height as keys

getOptionsMergedWithDefaults() protected method

protected getOptionsMergedWithDefaults ( array $additionalOptions = [] ) : array
$additionalOptions array
return array

injectSettings() public method

public injectSettings ( array $settings ) : void
$settings array
return void

isAnimatedGif() protected method

Detects whether the given GIF image data contains more than one frame
protected isAnimatedGif ( string $image ) : boolean
$image string string containing the binary GIF data
return boolean true if gif contains more than one frame

processImage() public method

public processImage ( PersistentResource $originalResource, array $adjustments ) : array
$originalResource Neos\Flow\ResourceManagement\PersistentResource
$adjustments array
return array resource, width, height as keys

Property Details

$assetRepository protected property

protected AssetRepository,Neos\Media\Domain\Repository $assetRepository
return Neos\Media\Domain\Repository\AssetRepository

$environment protected property

protected Environment,Neos\Flow\Utility $environment
return Neos\Flow\Utility\Environment

$imageSizeCache protected property

protected VariableFrontend,Neos\Cache\Frontend $imageSizeCache
return Neos\Cache\Frontend\VariableFrontend

$imagineService protected property

protected ImagineInterface,Imagine\Image $imagineService
return Imagine\Image\ImagineInterface

$resourceManager protected property

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

$settings protected property

protected array $settings
return array