PHP Class Neos\Media\Domain\Model\Adjustment\ResizeImageAdjustment

Inheritance: extends AbstractImageAdjustment
Afficher le fichier Open project: neos/neos-development-collection

Protected Properties

Свойство Type Description
$allowUpScaling boolean
$height integer
$maximumHeight integer
$maximumWidth integer
$minimumHeight integer
$minimumWidth integer
$position integer
$ratioMode string One of the ImagineImageInterface::RATIOMODE_* constants
$width integer

Méthodes publiques

Méthode Description
applyToImage ( Imagine\Image\ImageInterface $image ) : Imagine\Image\ImageInterface Applies this adjustment to the given Imagine Image object
canBeApplied ( Imagine\Image\ImageInterface $image ) : boolean Check if this Adjustment can or should be applied to its ImageVariant.
getAllowUpScaling ( ) : boolean Returns allowUpScaling
getHeight ( ) : integer Returns height
getMaximumHeight ( ) : integer Returns maximumHeight
getMaximumWidth ( ) : integer Returns maximumWidth
getMinimumHeight ( ) : integer Returns minimumHeight
getMinimumWidth ( ) : integer Returns minimumWidth
getRatioMode ( ) : string Returns ratioMode
getWidth ( ) : integer Returns width
setAllowUpScaling ( boolean $allowUpScaling ) : void Sets allowUpScaling
setHeight ( integer $height ) : void Sets height
setMaximumHeight ( integer $maximumHeight ) : void Sets maximumHeight
setMaximumWidth ( integer $maximumWidth ) : void Sets maximumWidth
setMinimumHeight ( integer $minimumHeight ) : void Sets minimumHeight
setMinimumWidth ( integer $minimumWidth ) : void Sets minimumWidth
setRatioMode ( string $ratioMode ) : void Sets ratioMode
setWidth ( integer $width ) : void Sets width

Méthodes protégées

Méthode Description
calculateDimensions ( Imagine\Image\BoxInterface $originalDimensions ) : Imagine\Image\BoxInterface Calculates and returns the dimensions the image should have according all parameters set in this adjustment.
calculateOutboundBox ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth, integer $requestedHeight ) : Imagine\Image\BoxInterface Calculate the final dimensions for an outbound box. usually exactly the requested width and height unless that would require upscaling and it is not allowed.
calculateOutboundScalingDimensions ( Imagine\Image\BoxInterface $imageSize, Imagine\Image\BoxInterface $requestedDimensions ) : Imagine\Image\BoxInterface Calculates a resize dimension box that allows for outbound resize.
calculateScalingToHeight ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedHeight ) : Imagine\Image\BoxInterface Calculates new dimensions with a requested height applied. Takes upscaling into consideration.
calculateScalingToWidth ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth ) : Imagine\Image\BoxInterface Calculates new dimensions with a requested width applied. Takes upscaling into consideration.
calculateWithFixedDimensions ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth, integer $requestedHeight ) : Imagine\Image\BoxInterface
resize ( Imagine\Image\ImageInterface $image, string $mode = ImageInterface::RATIOMODE_INSET, string $filter = ImagineImageInterface::FILTER_UNDEFINED ) : Imagine\Image\ManipulatorInterface Executes the actual resizing operation on the Imagine image.

Method Details

applyToImage() public méthode

Applies this adjustment to the given Imagine Image object
public applyToImage ( Imagine\Image\ImageInterface $image ) : Imagine\Image\ImageInterface
$image Imagine\Image\ImageInterface
Résultat Imagine\Image\ImageInterface

calculateDimensions() protected méthode

Calculates and returns the dimensions the image should have according all parameters set in this adjustment.
protected calculateDimensions ( Imagine\Image\BoxInterface $originalDimensions ) : Imagine\Image\BoxInterface
$originalDimensions Imagine\Image\BoxInterface Dimensions of the unadjusted image
Résultat Imagine\Image\BoxInterface

calculateOutboundBox() protected méthode

Calculate the final dimensions for an outbound box. usually exactly the requested width and height unless that would require upscaling and it is not allowed.
protected calculateOutboundBox ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth, integer $requestedHeight ) : Imagine\Image\BoxInterface
$originalDimensions Imagine\Image\BoxInterface
$requestedWidth integer
$requestedHeight integer
Résultat Imagine\Image\BoxInterface

calculateOutboundScalingDimensions() protected méthode

The scaled image will be bigger than the requested dimensions in one dimension and then cropped.
protected calculateOutboundScalingDimensions ( Imagine\Image\BoxInterface $imageSize, Imagine\Image\BoxInterface $requestedDimensions ) : Imagine\Image\BoxInterface
$imageSize Imagine\Image\BoxInterface
$requestedDimensions Imagine\Image\BoxInterface
Résultat Imagine\Image\BoxInterface

calculateScalingToHeight() protected méthode

Calculates new dimensions with a requested height applied. Takes upscaling into consideration.
protected calculateScalingToHeight ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedHeight ) : Imagine\Image\BoxInterface
$originalDimensions Imagine\Image\BoxInterface
$requestedHeight integer
Résultat Imagine\Image\BoxInterface

calculateScalingToWidth() protected méthode

Calculates new dimensions with a requested width applied. Takes upscaling into consideration.
protected calculateScalingToWidth ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth ) : Imagine\Image\BoxInterface
$originalDimensions Imagine\Image\BoxInterface
$requestedWidth integer
Résultat Imagine\Image\BoxInterface

calculateWithFixedDimensions() protected méthode

protected calculateWithFixedDimensions ( Imagine\Image\BoxInterface $originalDimensions, integer $requestedWidth, integer $requestedHeight ) : Imagine\Image\BoxInterface
$originalDimensions Imagine\Image\BoxInterface
$requestedWidth integer
$requestedHeight integer
Résultat Imagine\Image\BoxInterface

canBeApplied() public méthode

Check if this Adjustment can or should be applied to its ImageVariant.
public canBeApplied ( Imagine\Image\ImageInterface $image ) : boolean
$image Imagine\Image\ImageInterface
Résultat boolean

getAllowUpScaling() public méthode

Returns allowUpScaling
public getAllowUpScaling ( ) : boolean
Résultat boolean

getHeight() public méthode

Returns height
public getHeight ( ) : integer
Résultat integer

getMaximumHeight() public méthode

Returns maximumHeight
public getMaximumHeight ( ) : integer
Résultat integer

getMaximumWidth() public méthode

Returns maximumWidth
public getMaximumWidth ( ) : integer
Résultat integer

getMinimumHeight() public méthode

Returns minimumHeight
public getMinimumHeight ( ) : integer
Résultat integer

getMinimumWidth() public méthode

Returns minimumWidth
public getMinimumWidth ( ) : integer
Résultat integer

getRatioMode() public méthode

Returns ratioMode
public getRatioMode ( ) : string
Résultat string

getWidth() public méthode

Returns width
public getWidth ( ) : integer
Résultat integer

resize() protected méthode

In case of an outbound resize the image will be resized and cropped.
protected resize ( Imagine\Image\ImageInterface $image, string $mode = ImageInterface::RATIOMODE_INSET, string $filter = ImagineImageInterface::FILTER_UNDEFINED ) : Imagine\Image\ManipulatorInterface
$image Imagine\Image\ImageInterface
$mode string
$filter string
Résultat Imagine\Image\ManipulatorInterface

setAllowUpScaling() public méthode

Sets allowUpScaling
public setAllowUpScaling ( boolean $allowUpScaling ) : void
$allowUpScaling boolean
Résultat void

setHeight() public méthode

Sets height
public setHeight ( integer $height ) : void
$height integer
Résultat void

setMaximumHeight() public méthode

Sets maximumHeight
public setMaximumHeight ( integer $maximumHeight ) : void
$maximumHeight integer
Résultat void

setMaximumWidth() public méthode

Sets maximumWidth
public setMaximumWidth ( integer $maximumWidth ) : void
$maximumWidth integer
Résultat void

setMinimumHeight() public méthode

Sets minimumHeight
public setMinimumHeight ( integer $minimumHeight ) : void
$minimumHeight integer
Résultat void

setMinimumWidth() public méthode

Sets minimumWidth
public setMinimumWidth ( integer $minimumWidth ) : void
$minimumWidth integer
Résultat void

setRatioMode() public méthode

Sets ratioMode
public setRatioMode ( string $ratioMode ) : void
$ratioMode string One of the \Neos\Media\Domain\Model\ImageInterface::RATIOMODE_* constants
Résultat void

setWidth() public méthode

Sets width
public setWidth ( integer $width ) : void
$width integer
Résultat void

Property Details

$allowUpScaling protected_oe property

protected bool $allowUpScaling
Résultat boolean

$height protected_oe property

protected int $height
Résultat integer

$maximumHeight protected_oe property

protected int $maximumHeight
Résultat integer

$maximumWidth protected_oe property

protected int $maximumWidth
Résultat integer

$minimumHeight protected_oe property

protected int $minimumHeight
Résultat integer

$minimumWidth protected_oe property

protected int $minimumWidth
Résultat integer

$position protected_oe property

protected int $position
Résultat integer

$ratioMode protected_oe property

One of the ImagineImageInterface::RATIOMODE_* constants
protected string $ratioMode
Résultat string

$width protected_oe property

protected int $width
Résultat integer