PHP Class Pimcore\Image\Adapter

Show file Open project: pimcore/pimcore Class Usage Examples

Protected Properties

Property Type Description
$height integer
$isAlphaPossible boolean
$modified boolean
$preserveColor boolean
$preserveMetaData boolean
$reinitializing boolean
$tmpFiles array
$useContentOptimizedFormat boolean
$width integer

Public Methods

Method Description
__destruct ( )
addOverlay ( string $image, integer $x, integer $y, integer $alpha = 100, $composite = "COMPOSITE_DEFAULT", string $origin = 'top-left' ) : self
addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" )
applyMask ( $image ) : self
brightnessSaturation ( integer $brightness = 100, integer $saturation = 100, integer $hue = 100 )
colorhex2colorarray ( $colorhex ) : array
contain ( $width, $height ) : self
cover ( $width, $height, string $orientation = "center", $doNotScaleUp = true ) : self
crop ( $x, $y, $width, $height ) : self
cropPercent ( $width, $height, $x, $y ) : self
frame ( $width, $height )
gaussianBlur ( integer $radius, float $sigma = 1 )
getHeight ( ) : integer
getModified ( ) : boolean
getUseContentOptimizedFormat ( ) : boolean
getVectorRasterDimensions ( ) : array
getWidth ( ) : integer
grayscale ( ) : self
isPreserveColor ( ) : boolean
isPreserveMetaData ( ) : boolean
isVectorGraphic ( ) : boolean
load ( $imagePath, $options = [] ) : self
mirror ( $mode ) : self
postModify ( )
preModify ( )
resize ( $width, $height ) : self
rotate ( $angle )
roundCorners ( $width, $height )
save ( $path, null $format = null, null $quality = null ) : mixed
scaleByHeight ( $height, $forceResize = false ) : self
scaleByWidth ( $width, $forceResize = false ) : self
sepia ( ) : self
setBackgroundColor ( $color ) : self
setBackgroundImage ( $image ) : self
setColorspace ( string $type = "RGB" )
setHeight ( $height )
setIsAlphaPossible ( boolean $value )
setModified ( boolean $modified )
setPreserveColor ( boolean $preserveColor )
setPreserveMetaData ( boolean $preserveMetaData )
setUseContentOptimizedFormat ( boolean $useContentOptimizedFormat )
setWidth ( $width )
sharpen ( ) : self
trim ( integer $tolerance ) : self

Protected Methods

Method Description
destroy ( ) : void
reinitializeImage ( ) : void
removeTmpFiles ( ) : void

Method Details

__destruct() public method

public __destruct ( )

addOverlay() public method

public addOverlay ( string $image, integer $x, integer $y, integer $alpha = 100, $composite = "COMPOSITE_DEFAULT", string $origin = 'top-left' ) : self
$image string
$x integer
$y integer
$alpha integer
$origin string Origin of the X and Y coordinates (top-left, top-right, bottom-left, bottom-right or center)
return self

addOverlayFit() public method

public addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" )
$image
$composite string

applyMask() public method

public applyMask ( $image ) : self
$image
return self

brightnessSaturation() public method

public brightnessSaturation ( integer $brightness = 100, integer $saturation = 100, integer $hue = 100 )
$brightness integer
$saturation integer
$hue integer

colorhex2colorarray() public method

public colorhex2colorarray ( $colorhex ) : array
$colorhex
return array

contain() public method

public contain ( $width, $height ) : self
$width
$height
return self

cover() public method

public cover ( $width, $height, string $orientation = "center", $doNotScaleUp = true ) : self
$width
$height
$orientation string
return self

crop() public method

public crop ( $x, $y, $width, $height ) : self
$x
$y
$width
$height
return self

cropPercent() public method

public cropPercent ( $width, $height, $x, $y ) : self
$width
$height
$x
$y
return self

destroy() abstract protected method

abstract protected destroy ( ) : void
return void

frame() public method

public frame ( $width, $height )
$width
$height

gaussianBlur() public method

public gaussianBlur ( integer $radius, float $sigma = 1 )
$radius integer
$sigma float

getHeight() public method

public getHeight ( ) : integer
return integer

getModified() public method

public getModified ( ) : boolean
return boolean

getUseContentOptimizedFormat() public method

getVectorRasterDimensions() public method

public getVectorRasterDimensions ( ) : array
return array

getWidth() public method

public getWidth ( ) : integer
return integer

grayscale() public method

public grayscale ( ) : self
return self

isPreserveColor() public method

public isPreserveColor ( ) : boolean
return boolean

isPreserveMetaData() public method

public isPreserveMetaData ( ) : boolean
return boolean

isVectorGraphic() public method

public isVectorGraphic ( ) : boolean
return boolean

load() abstract public method

abstract public load ( $imagePath, $options = [] ) : self
$imagePath
return self

mirror() public method

public mirror ( $mode ) : self
return self

postModify() public method

public postModify ( )

preModify() public method

public preModify ( )

reinitializeImage() protected method

protected reinitializeImage ( ) : void
return void

removeTmpFiles() protected method

protected removeTmpFiles ( ) : void
return void

resize() public method

public resize ( $width, $height ) : self
$width
$height
return self

rotate() public method

public rotate ( $angle )
$angle

roundCorners() public method

public roundCorners ( $width, $height )
$width
$height

save() abstract public method

abstract public save ( $path, null $format = null, null $quality = null ) : mixed
$path
$format null
$quality null
return mixed

scaleByHeight() public method

public scaleByHeight ( $height, $forceResize = false ) : self
$height
return self

scaleByWidth() public method

public scaleByWidth ( $width, $forceResize = false ) : self
$width
return self

sepia() public method

public sepia ( ) : self
return self

setBackgroundColor() public method

public setBackgroundColor ( $color ) : self
$color
return self

setBackgroundImage() public method

public setBackgroundImage ( $image ) : self
$image
return self

setColorspace() public method

public setColorspace ( string $type = "RGB" )
$type string

setHeight() public method

public setHeight ( $height )
$height

setIsAlphaPossible() public method

public setIsAlphaPossible ( boolean $value )
$value boolean

setModified() public method

public setModified ( boolean $modified )
$modified boolean

setPreserveColor() public method

public setPreserveColor ( boolean $preserveColor )
$preserveColor boolean

setPreserveMetaData() public method

public setPreserveMetaData ( boolean $preserveMetaData )
$preserveMetaData boolean

setUseContentOptimizedFormat() public method

public setUseContentOptimizedFormat ( boolean $useContentOptimizedFormat )
$useContentOptimizedFormat boolean

setWidth() public method

public setWidth ( $width )
$width

sharpen() public method

public sharpen ( ) : self
return self

trim() public method

public trim ( integer $tolerance ) : self
$tolerance integer
return self

Property Details

$height protected property

protected int $height
return integer

$isAlphaPossible protected property

protected bool $isAlphaPossible
return boolean

$modified protected property

protected bool $modified
return boolean

$preserveColor protected property

protected bool $preserveColor
return boolean

$preserveMetaData protected property

protected bool $preserveMetaData
return boolean

$reinitializing protected property

protected bool $reinitializing
return boolean

$tmpFiles protected property

protected array $tmpFiles
return array

$useContentOptimizedFormat protected property

protected bool $useContentOptimizedFormat
return boolean

$width protected property

protected int $width
return integer