PHP Класс Pimcore\Image\Adapter\ImageMagick

Наследование: extends Pimcore\Image\Adapter
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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 )

Описание методов

addCompositeOption() публичный метод

Add option available in the composite tool
public addCompositeOption ( $name, null $value = null ) : ImageMagick
$name
$value null
Результат ImageMagick

addConvertOption() публичный метод

Add option to the command
public addConvertOption ( $name, null $value = null ) : ImageMagick
$name
$value null
Результат ImageMagick

addFilter() публичный метод

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

addOverlay() публичный метод

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
Результат ImageMagick

addOverlayFit() публичный метод

public addOverlayFit ( $image, string $composite = "COMPOSITE_DEFAULT" ) : ImageMagick
$image
$composite string
Результат ImageMagick

applyMask() публичный метод

Add mask to the image
public applyMask ( $image ) : ImageMagick
$image
Результат ImageMagick

brightnessSaturation() публичный метод

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
Результат ImageMagick

createTmpImage() защищенный метод

Creates the tmp image, that image will be automatically deleted when the process finishes.
protected createTmpImage ( $imagePath, $suffix ) : ImageMagick
$imagePath
$suffix
Результат ImageMagick

crop() публичный метод

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
Результат ImageMagick

cropPercent() публичный метод

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 destroy ( ) : ImageMagick
Результат ImageMagick

frame() публичный метод

Adds frame which cause that the image gets exactly the entered dimensions by adding borders.
public frame ( $width, $height ) : ImageMagick
$width
$height
Результат ImageMagick

gaussianBlur() публичный метод

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

generateCanvas() публичный метод

It generates a basic canvas file with specified size and color
public generateCanvas ( $width, $height, $color ) : ImageMagick
$width
$height
$color
Результат ImageMagick

getCompositeCommand() публичный метод

Return the composite command as a string
public getCompositeCommand ( ) : string
Результат string

getCompositeOptionsAsString() публичный метод

Returns the composite options as a string
public getCompositeOptionsAsString ( ) : string
Результат string

getCompositeScriptPath() публичный метод

Returns the composite cli script path.
public getCompositeScriptPath ( ) : string
Результат string

getConvertCommand() публичный метод

Return the command without an output file path
public getConvertCommand ( ) : string
Результат string

getConvertFilters() публичный метод

Returns the filters array
public getConvertFilters ( $optionName ) : array
$optionName
Результат array

getConvertOptionsAsString() публичный метод

Returns options parameter for the convert command
public getConvertOptionsAsString ( ) : string
Результат string

getConvertScriptPath() публичный метод

Returns the convert cli script path.
public getConvertScriptPath ( ) : string
Результат string

getForceAlpha() публичный метод

public getForceAlpha ( ) : boolean
Результат boolean

getOutputPath() публичный метод

public getOutputPath ( ) : null | string
Результат null | string

grayscale() публичный метод

Converts the image into a linear-grayscale image.
public grayscale ( $method = "Rec601Luma" ) : ImageMagick
Результат ImageMagick

initResource() защищенный метод

protected initResource ( ) : ImageMagick
Результат ImageMagick

load() публичный метод

loads the image by the specified path
public load ( $imagePath, array $options = [] ) : ImageMagick
$imagePath
$options array
Результат ImageMagick

mergeImage() публичный метод

Merges the image specified as the argument into the main picture.
public mergeImage ( ImageMagick $backgroundImage ) : ImageMagick
$backgroundImage ImageMagick
Результат ImageMagick

mirror() публичный метод

Creates vertical or horizontal mirror of the image.
public mirror ( $mode ) : ImageMagick
$mode
Результат ImageMagick

processCommand() защищенный метод

protected processCommand ( $command ) : integer
$command
Результат integer

processOverlay() защищенный метод

protected processOverlay ( ImageMagick $overlayImage, string $composite = "COMPOSITE_DEFAULT", $x, $y, $overlayOpacity = 100 ) : ImageMagick
$overlayImage ImageMagick
$composite string
Результат ImageMagick

resize() публичный метод

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

rotate() публичный метод

Rotates the image with the given angle.
public rotate ( $angle ) : ImageMagick
$angle
Результат ImageMagick

roundCorners() публичный метод

Rounds the corners to the given width/height.
public roundCorners ( $width, $height ) : ImageMagick
$width
$height
Результат ImageMagick

save() публичный метод

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 saveIfRequired ( string $suffix )
$suffix string a thumbnail identifier

sepia() публичный метод

Applies the sepia effect into the image.
public sepia ( ) : ImageMagick
Результат ImageMagick

setBackgroundColor() публичный метод

Set the background color of the image.
public setBackgroundColor ( $color ) : ImageMagick
$color
Результат ImageMagick

setBackgroundImage() публичный метод

Set the image background
public setBackgroundImage ( $image, null $mode = null, $relativePath = false ) : ImageMagick
$image
$mode null
Результат ImageMagick

setCompositeScriptPath() публичный метод

Composite script path, as a default the adapter is just using 'composite'.
public setCompositeScriptPath ( $compositeScriptPath ) : ImageMagick
Результат ImageMagick

setConvertScriptPath() публичный метод

Convert script path, as a default the adapter is just using 'convert'.
public setConvertScriptPath ( $convertScriptPath ) : ImageMagick
$convertScriptPath
Результат ImageMagick

setForceAlpha() публичный метод

public setForceAlpha ( boolean $forceAlpha ) : ImageMagick
$forceAlpha boolean
Результат ImageMagick

setOutputPath() публичный метод

public setOutputPath ( $path ) : ImageMagick
$path
Результат ImageMagick

setTmpPaths() защищенный метод

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

sharpen() публичный метод

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
Результат ImageMagick

trim() публичный метод

Trims edges
public trim ( integer $tolerance ) : ImageMagick
$tolerance integer
Результат ImageMagick

Описание свойств

$compositeCommandOptions защищенное свойство

Options used by the composite script
protected array $compositeCommandOptions
Результат array

$compositeScriptPath защищенное свойство

protected string $compositeScriptPath
Результат string

$convertCommandOptions защищенное свойство

Options used by the convert script
protected array $convertCommandOptions
Результат array

$convertFilters защищенное свойство

Array with filters used with options
protected array $convertFilters
Результат array

$convertScriptPath защищенное свойство

protected string $convertScriptPath
Результат string

$forceAlpha защищенное свойство

protected null $forceAlpha
Результат null

$imagePath защищенное свойство

The base image path
protected null|string $imagePath
Результат null | string

$outputPath защищенное свойство

protected null|string $outputPath
Результат null | string

$resource защищенное свойство

protected null|Imagick,Pimcore\Image\Adapter $resource
Результат null | Imagick