PHP Class Pimcore\Image\Adapter\ImageMagick

Inheritance: extends Pimcore\Image\Adapter
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Protected Properties

Свойство Type Description
$compositeCommandOptions array Options used by the composite script
$compositeScriptPath string
$convertCommandOptions array Options used by the convert script
$convertFilters array Array with filters used with options
$convertScriptPath string
$forceAlpha null
$imagePath null | string The base image path
$outputPath null | string
$resource null | Imagick

Méthodes publiques

Méthode Description
addCompositeOption ( $name, null $value = null ) : ImageMagick Add option available in the composite tool
addConvertOption ( $name, null $value = null ) : ImageMagick Add option to the command
addFilter ( $optionName, $filterValue ) Add a filter to the convert command
addOverlay ( string $image, integer $x, integer $y, integer $alpha = 100, string $composite = "COMPOSITE_DEFAULT", string $origin = 'top-left' ) : ImageMagick
addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" ) : ImageMagick
applyMask ( $image ) : ImageMagick Add mask to the image
brightnessSaturation ( integer $brightness = 100, integer $saturation = 100, integer $hue = 100 ) : ImageMagick Brightness, saturation and hue setting of the image.
crop ( $x, $y, $width, $height ) : ImageMagick Cuts out a box of the image starting at the given X,Y coordinates and using the width and height.
cropPercent ( $x, $y, $width, $height ) Cuts out a box of the image starting at the given X,Y coordinates and using percentage values of width and height.
frame ( $width, $height ) : ImageMagick Adds frame which cause that the image gets exactly the entered dimensions by adding borders.
gaussianBlur ( integer $radius, float $sigma = 1 ) Blur the image.
generateCanvas ( $width, $height, $color ) : ImageMagick It generates a basic canvas file with specified size and color
getCompositeCommand ( ) : string Return the composite command as a string
getCompositeOptionsAsString ( ) : string Returns the composite options as a string
getCompositeScriptPath ( ) : string Returns the composite cli script path.
getConvertCommand ( ) : string Return the command without an output file path
getConvertFilters ( $optionName ) : array Returns the filters array
getConvertOptionsAsString ( ) : string Returns options parameter for the convert command
getConvertScriptPath ( ) : string Returns the convert cli script path.
getForceAlpha ( ) : boolean
getOutputPath ( ) : null | string
grayscale ( $method = "Rec601Luma" ) : ImageMagick Converts the image into a linear-grayscale image.
load ( $imagePath, array $options = [] ) : ImageMagick loads the image by the specified path
mergeImage ( ImageMagick $backgroundImage ) : ImageMagick Merges the image specified as the argument into the main picture.
mirror ( $mode ) : ImageMagick Creates vertical or horizontal mirror of the image.
resize ( $width, $height ) Resize the image
rotate ( $angle ) : ImageMagick Rotates the image with the given angle.
roundCorners ( $width, $height ) : ImageMagick Rounds the corners to the given width/height.
save ( $path, null $format = null, null $quality = null ) Save the modified image output in the specified path as the first argument.
saveIfRequired ( string $suffix )
sepia ( ) : ImageMagick Applies the sepia effect into the image.
setBackgroundColor ( $color ) : ImageMagick Set the background color of the image.
setBackgroundImage ( $image, null $mode = null, $relativePath = false ) : ImageMagick Set the image background
setCompositeScriptPath ( $compositeScriptPath ) : ImageMagick Composite script path, as a default the adapter is just using 'composite'.
setConvertScriptPath ( $convertScriptPath ) : ImageMagick Convert script path, as a default the adapter is just using 'convert'.
setForceAlpha ( boolean $forceAlpha ) : ImageMagick
setOutputPath ( $path ) : ImageMagick
sharpen ( integer $radius, float $sigma = 1, float $amount = 1, float $threshold = 0.05 ) : ImageMagick Sharpen the image.
trim ( integer $tolerance ) : ImageMagick Trims edges

Méthodes protégées

Méthode Description
createTmpImage ( $imagePath, $suffix ) : ImageMagick Creates the tmp image, that image will be automatically deleted when the process finishes.
destroy ( ) : ImageMagick
initResource ( ) : ImageMagick
processCommand ( $command ) : integer
processOverlay ( ImageMagick $overlayImage, string $composite = "COMPOSITE_DEFAULT", $x, $y, $overlayOpacity = 100 ) : ImageMagick
setTmpPaths ( ImageMagick $image, $suffix )

Method Details

addCompositeOption() public méthode

Add option available in the composite tool
public addCompositeOption ( $name, null $value = null ) : ImageMagick
$name
$value null
Résultat ImageMagick

addConvertOption() public méthode

Add option to the command
public addConvertOption ( $name, null $value = null ) : ImageMagick
$name
$value null
Résultat ImageMagick

addFilter() public méthode

Add a filter to the convert command
public addFilter ( $optionName, $filterValue )
$optionName
$filterValue

addOverlay() public méthode

public addOverlay ( string $image, integer $x, integer $y, integer $alpha = 100, string $composite = "COMPOSITE_DEFAULT", string $origin = 'top-left' ) : ImageMagick
$image string
$x integer
$y integer
$alpha integer
$composite string
$origin string
Résultat ImageMagick

addOverlayFit() public méthode

public addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" ) : ImageMagick
$image
$composite string
Résultat ImageMagick

applyMask() public méthode

Add mask to the image
public applyMask ( $image ) : ImageMagick
$image
Résultat ImageMagick

brightnessSaturation() public méthode

Brightness, saturation and hue setting of the image.
public brightnessSaturation ( integer $brightness = 100, integer $saturation = 100, integer $hue = 100 ) : ImageMagick
$brightness integer
$saturation integer
$hue integer
Résultat ImageMagick

createTmpImage() protected méthode

Creates the tmp image, that image will be automatically deleted when the process finishes.
protected createTmpImage ( $imagePath, $suffix ) : ImageMagick
$imagePath
$suffix
Résultat ImageMagick

crop() public méthode

Cuts out a box of the image starting at the given X,Y coordinates and using the width and height.
public crop ( $x, $y, $width, $height ) : ImageMagick
$x
$y
$width
$height
Résultat ImageMagick

cropPercent() public méthode

Cuts out a box of the image starting at the given X,Y coordinates and using percentage values of width and height.
public cropPercent ( $x, $y, $width, $height )
$x
$y
$width
$height

destroy() protected méthode

protected destroy ( ) : ImageMagick
Résultat ImageMagick

frame() public méthode

Adds frame which cause that the image gets exactly the entered dimensions by adding borders.
public frame ( $width, $height ) : ImageMagick
$width
$height
Résultat ImageMagick

gaussianBlur() public méthode

Blur the image.
public gaussianBlur ( integer $radius, float $sigma = 1 )
$radius integer
$sigma float

generateCanvas() public méthode

It generates a basic canvas file with specified size and color
public generateCanvas ( $width, $height, $color ) : ImageMagick
$width
$height
$color
Résultat ImageMagick

getCompositeCommand() public méthode

Return the composite command as a string
public getCompositeCommand ( ) : string
Résultat string

getCompositeOptionsAsString() public méthode

Returns the composite options as a string
public getCompositeOptionsAsString ( ) : string
Résultat string

getCompositeScriptPath() public méthode

Returns the composite cli script path.
public getCompositeScriptPath ( ) : string
Résultat string

getConvertCommand() public méthode

Return the command without an output file path
public getConvertCommand ( ) : string
Résultat string

getConvertFilters() public méthode

Returns the filters array
public getConvertFilters ( $optionName ) : array
$optionName
Résultat array

getConvertOptionsAsString() public méthode

Returns options parameter for the convert command
public getConvertOptionsAsString ( ) : string
Résultat string

getConvertScriptPath() public méthode

Returns the convert cli script path.
public getConvertScriptPath ( ) : string
Résultat string

getForceAlpha() public méthode

public getForceAlpha ( ) : boolean
Résultat boolean

getOutputPath() public méthode

public getOutputPath ( ) : null | string
Résultat null | string

grayscale() public méthode

Converts the image into a linear-grayscale image.
public grayscale ( $method = "Rec601Luma" ) : ImageMagick
Résultat ImageMagick

initResource() protected méthode

protected initResource ( ) : ImageMagick
Résultat ImageMagick

load() public méthode

loads the image by the specified path
public load ( $imagePath, array $options = [] ) : ImageMagick
$imagePath
$options array
Résultat ImageMagick

mergeImage() public méthode

Merges the image specified as the argument into the main picture.
public mergeImage ( ImageMagick $backgroundImage ) : ImageMagick
$backgroundImage ImageMagick
Résultat ImageMagick

mirror() public méthode

Creates vertical or horizontal mirror of the image.
public mirror ( $mode ) : ImageMagick
$mode
Résultat ImageMagick

processCommand() protected méthode

protected processCommand ( $command ) : integer
$command
Résultat integer

processOverlay() protected méthode

protected processOverlay ( ImageMagick $overlayImage, string $composite = "COMPOSITE_DEFAULT", $x, $y, $overlayOpacity = 100 ) : ImageMagick
$overlayImage ImageMagick
$composite string
Résultat ImageMagick

resize() public méthode

Resize the image
public resize ( $width, $height )
$width
$height

rotate() public méthode

Rotates the image with the given angle.
public rotate ( $angle ) : ImageMagick
$angle
Résultat ImageMagick

roundCorners() public méthode

Rounds the corners to the given width/height.
public roundCorners ( $width, $height ) : ImageMagick
$width
$height
Résultat ImageMagick

save() public méthode

Save the modified image output in the specified path as the first argument.
public save ( $path, null $format = null, null $quality = null )
$path
$format null
$quality null

saveIfRequired() public méthode

public saveIfRequired ( string $suffix )
$suffix string a thumbnail identifier

sepia() public méthode

Applies the sepia effect into the image.
public sepia ( ) : ImageMagick
Résultat ImageMagick

setBackgroundColor() public méthode

Set the background color of the image.
public setBackgroundColor ( $color ) : ImageMagick
$color
Résultat ImageMagick

setBackgroundImage() public méthode

Set the image background
public setBackgroundImage ( $image, null $mode = null, $relativePath = false ) : ImageMagick
$image
$mode null
Résultat ImageMagick

setCompositeScriptPath() public méthode

Composite script path, as a default the adapter is just using 'composite'.
public setCompositeScriptPath ( $compositeScriptPath ) : ImageMagick
Résultat ImageMagick

setConvertScriptPath() public méthode

Convert script path, as a default the adapter is just using 'convert'.
public setConvertScriptPath ( $convertScriptPath ) : ImageMagick
$convertScriptPath
Résultat ImageMagick

setForceAlpha() public méthode

public setForceAlpha ( boolean $forceAlpha ) : ImageMagick
$forceAlpha boolean
Résultat ImageMagick

setOutputPath() public méthode

public setOutputPath ( $path ) : ImageMagick
$path
Résultat ImageMagick

setTmpPaths() protected méthode

protected setTmpPaths ( ImageMagick $image, $suffix )
$image ImageMagick

sharpen() public méthode

Sharpen the image.
public sharpen ( integer $radius, float $sigma = 1, float $amount = 1, float $threshold = 0.05 ) : ImageMagick
$radius integer
$sigma float
$amount float
$threshold float
Résultat ImageMagick

trim() public méthode

Trims edges
public trim ( integer $tolerance ) : ImageMagick
$tolerance integer
Résultat ImageMagick

Property Details

$compositeCommandOptions protected_oe property

Options used by the composite script
protected array $compositeCommandOptions
Résultat array

$compositeScriptPath protected_oe property

protected string $compositeScriptPath
Résultat string

$convertCommandOptions protected_oe property

Options used by the convert script
protected array $convertCommandOptions
Résultat array

$convertFilters protected_oe property

Array with filters used with options
protected array $convertFilters
Résultat array

$convertScriptPath protected_oe property

protected string $convertScriptPath
Résultat string

$forceAlpha protected_oe property

protected null $forceAlpha
Résultat null

$imagePath protected_oe property

The base image path
protected null|string $imagePath
Résultat null | string

$outputPath protected_oe property

protected null|string $outputPath
Résultat null | string

$resource protected_oe property

protected null|Imagick,Pimcore\Image\Adapter $resource
Résultat null | Imagick