PHP Class Spatie\MediaLibrary\Conversion\Conversion

Show file Open project: spatie/laravel-medialibrary Class Usage Examples

Protected Properties

Property Type Description
$extractVideoFrameAtSecond integer
$manipulations array
$name name
$performOnCollections array
$performOnQueue boolean

Public Methods

Method Description
__construct ( string $name )
addAsFirstManipulation ( array $manipulation ) Add the given manipulation as the first manipulation.
create ( string $name )
getExtractVideoFrameAtSecond ( ) : integer
getManipulations ( ) : array Get the manipulations of this conversion.
getName ( ) : string
getResultExtension ( string $originalFileExtension = '' ) : string * Get the extension that the result of this conversion must have.
nonQueued ( ) Mark this conversion as one that should not be queued.
performOnCollections ( variadic $collectionNames ) Set the collection names on which this conversion must be performed.
queued ( ) Mark this conversion as one that should be queued.
setCrop ( integer $width, integer $height, integer $x, integer $y ) Crops the image to specific dimensions prior to any other resize operations.
setExtractVideoFrameAtSecond ( integer $timecode ) : Conversion * Set the timecode in seconds to extract a video thumbnail.
setFit ( string $fit ) Set the target fit.
setFormat ( string $format ) Set the target format.
setHeight ( integer $height ) Set the target height.
setManipulationParameter ( string $name, string $value ) Set the manipulation parameter.
setManipulations ( $manipulations ) Set the manipulations for this conversion.
setWidth ( integer $width ) Set the target width.
shouldBePerformedOn ( string $collectionName ) : boolean * Determine if this conversion should be performed on the given collection.
shouldBeQueued ( ) : boolean * Determine if the conversion should be queued.

Protected Methods

Method Description
containsFormatManipulation ( array $manipulations ) : boolean * Determine if the given manipulations contain a format manipulation.

Method Details

__construct() public method

public __construct ( string $name )
$name string

addAsFirstManipulation() public method

Add the given manipulation as the first manipulation.
public addAsFirstManipulation ( array $manipulation )
$manipulation array

containsFormatManipulation() protected method

* Determine if the given manipulations contain a format manipulation.
protected containsFormatManipulation ( array $manipulations ) : boolean
$manipulations array
return boolean

create() public static method

public static create ( string $name )
$name string

getExtractVideoFrameAtSecond() public method

getManipulations() public method

Get the manipulations of this conversion.
public getManipulations ( ) : array
return array

getName() public method

public getName ( ) : string
return string

getResultExtension() public method

* Get the extension that the result of this conversion must have.
public getResultExtension ( string $originalFileExtension = '' ) : string
$originalFileExtension string
return string

nonQueued() public method

Mark this conversion as one that should not be queued.
public nonQueued ( )

performOnCollections() public method

Set the collection names on which this conversion must be performed.
public performOnCollections ( variadic $collectionNames )
$collectionNames variadic

queued() public method

Mark this conversion as one that should be queued.
public queued ( )

setCrop() public method

Crops the image to specific dimensions prior to any other resize operations.
public setCrop ( integer $width, integer $height, integer $x, integer $y )
$width integer
$height integer
$x integer
$y integer

setExtractVideoFrameAtSecond() public method

Only used on video media.
public setExtractVideoFrameAtSecond ( integer $timecode ) : Conversion
$timecode integer
return Conversion

setFit() public method

Matches with Glide's 'fit'-parameter.
public setFit ( string $fit )
$fit string

setFormat() public method

Matches with Glide's 'fm'-parameter.
public setFormat ( string $format )
$format string

setHeight() public method

Matches with Glide's 'h'-parameter.
public setHeight ( integer $height )
$height integer

setManipulationParameter() public method

Set the manipulation parameter.
public setManipulationParameter ( string $name, string $value )
$name string
$value string

setManipulations() public method

Set the manipulations for this conversion.
public setManipulations ( $manipulations )
$manipulations

setWidth() public method

Matches with Glide's 'w'-parameter.
public setWidth ( integer $width )
$width integer

shouldBePerformedOn() public method

* Determine if this conversion should be performed on the given collection.
public shouldBePerformedOn ( string $collectionName ) : boolean
$collectionName string
return boolean

shouldBeQueued() public method

* Determine if the conversion should be queued.
public shouldBeQueued ( ) : boolean
return boolean

Property Details

$extractVideoFrameAtSecond protected property

protected int $extractVideoFrameAtSecond
return integer

$manipulations protected property

protected array $manipulations
return array

$name protected property

name
protected $name

$performOnCollections protected property

protected array $performOnCollections
return array

$performOnQueue protected property

protected bool $performOnQueue
return boolean