class Format extends BaseAction implements FormatInterface

Defines the format of the delivered asset.

Learn more: Image formats | Video formats

Methods

__construct(array ...$value)

Format constructor.

addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

setGenericAction(string $action)

Adds (sets) generic (raw) action.

setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

unsetFlag(FlagQualifier $flag)

Removes the flag.

importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

jsonSerialize()

Serializes to json.

__toString()

Serializes to Cloudinary URL format

audioMp3()

Audio format mp3.

audioAac()

Audio format aac.

audioM4a()

Audio format m4a.

audioOgg()

Audio format ogg.

audioWav()

Audio format wav.

audioAiff()

Audio format aiff.

audioFlac()

Audio format flac.

audioAmr()

Audio format amr.

audioMidi()

Audio format midi.

jpg()

Image format jpg.

jpc()

Image format jpc.

jp2()

Image format jp2.

wdp()

Image format wdp.

png()

Image format png.

gif()

Image format gif.

webp()

Image format webp.

bmp()

Image format bmp.

tiff()

Image format tiff.

ico()

Image format ico.

pdf()

Image format pdf.

eps()

Image format eps.

psd()

Image format psd.

svg()

Image format svg.

ai()

Image format ai.

djvu()

Image format djvu.

avif()

Image format avif.

flif()

Image format flif.

usdz()

Image format usdz.

videoMp4()

Video format mp4.

videoTs()

Video format ts.

videoMov()

Video format mov.

videoFlv()

Video format flv.

videoWebm()

Video format webm.

videoOgv()

Video format ogv.

videoM3u8()

Video format m3u8.

videoMpd()

Video format mpd.

videoMkv()

Video format mkv.

videoAvi()

Video format avi.

video3gp()

Video format 3gp.

video3g2()

Video format 3g2.

videoWmv()

Video format wmv.

videoMpeg()

Video format mpeg.

auto()

Auto format.

format(string $format)

Sets file format.

lossy(bool $useLossy = true)

Automatically use lossy compression when delivering animated GIF files.

progressive(string $mode = null)

Applicable only for JPG file format

preserveTransparency()

Ensures that images with a transparency channel will be delivered in PNG format.

ignoreMaskChannels()

Ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.

Details

__construct(array ...$value)

Format constructor.

Parameters

Name Type Description
...$value array

$this addQualifier(BaseComponent $qualifier = null)

Adds the qualifier to the action.

Parameters

Name Type Description
$qualifier BaseComponent The qualifier to add.

Return Value

$this

$this addQualifiers(array ...$qualifiers)

Adds qualifiers to the action.

Parameters

Name Type Description
...$qualifiers array The qualifiers to add.

Return Value

$this

BaseAction setGenericAction(string $action)

Adds (sets) generic (raw) action.

Parameters

Name Type Description
$action string The generic action string.

Return Value

BaseAction

$this setFlag(FlagQualifier $flag, bool $set = true)

Sets the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to set.
$set bool Indicates whether to set(true) or unset(false) the flag instead. (Used for avoiding if conditions all over the code)

Return Value

$this

$this unsetFlag(FlagQualifier $flag)

Removes the flag.

Parameters

Name Type Description
$flag FlagQualifier The flag to unset.

Return Value

$this

$this importAction(BaseAction|null $action)

Imports (merges) qualifiers and flags from another action.

Parameters

Name Type Description
$action BaseAction|null The action to import.

Return Value

$this

mixed jsonSerialize()

Serializes to json.

Return Value

mixed

string __toString()

Serializes to Cloudinary URL format

Return Value

string

static AudioFormatTrait audioMp3()

Audio format mp3.

Return Value

AudioFormatTrait

static AudioFormatTrait audioAac()

Audio format aac.

Return Value

AudioFormatTrait

static AudioFormatTrait audioM4a()

Audio format m4a.

Return Value

AudioFormatTrait

static AudioFormatTrait audioOgg()

Audio format ogg.

Return Value

AudioFormatTrait

static AudioFormatTrait audioWav()

Audio format wav.

Return Value

AudioFormatTrait

static AudioFormatTrait audioAiff()

Audio format aiff.

Return Value

AudioFormatTrait

static AudioFormatTrait audioFlac()

Audio format flac.

Return Value

AudioFormatTrait

static AudioFormatTrait audioAmr()

Audio format amr.

Return Value

AudioFormatTrait

static AudioFormatTrait audioMidi()

Audio format midi.

Return Value

AudioFormatTrait

static ImageFormatTrait jpg()

Image format jpg.

Return Value

ImageFormatTrait

static ImageFormatTrait jpc()

Image format jpc.

Return Value

ImageFormatTrait

static ImageFormatTrait jp2()

Image format jp2.

Return Value

ImageFormatTrait

static ImageFormatTrait wdp()

Image format wdp.

Return Value

ImageFormatTrait

static ImageFormatTrait png()

Image format png.

Return Value

ImageFormatTrait

static ImageFormatTrait gif()

Image format gif.

Return Value

ImageFormatTrait

static ImageFormatTrait webp()

Image format webp.

Return Value

ImageFormatTrait

static ImageFormatTrait bmp()

Image format bmp.

Return Value

ImageFormatTrait

static ImageFormatTrait tiff()

Image format tiff.

Return Value

ImageFormatTrait

static ImageFormatTrait ico()

Image format ico.

Return Value

ImageFormatTrait

static ImageFormatTrait pdf()

Image format pdf.

Return Value

ImageFormatTrait

static ImageFormatTrait eps()

Image format eps.

Return Value

ImageFormatTrait

static ImageFormatTrait psd()

Image format psd.

Return Value

ImageFormatTrait

static ImageFormatTrait svg()

Image format svg.

Return Value

ImageFormatTrait

static ImageFormatTrait ai()

Image format ai.

Return Value

ImageFormatTrait

static ImageFormatTrait djvu()

Image format djvu.

Return Value

ImageFormatTrait

static ImageFormatTrait avif()

Image format avif.

Return Value

ImageFormatTrait

static ImageFormatTrait flif()

Image format flif.

Return Value

ImageFormatTrait

static ImageFormatTrait usdz()

Image format usdz.

Return Value

ImageFormatTrait

static VideoFormatTrait videoMp4()

Video format mp4.

Return Value

VideoFormatTrait

static VideoFormatTrait videoTs()

Video format ts.

Return Value

VideoFormatTrait

static VideoFormatTrait videoMov()

Video format mov.

Return Value

VideoFormatTrait

static VideoFormatTrait videoFlv()

Video format flv.

Return Value

VideoFormatTrait

static VideoFormatTrait videoWebm()

Video format webm.

Return Value

VideoFormatTrait

static VideoFormatTrait videoOgv()

Video format ogv.

Return Value

VideoFormatTrait

static VideoFormatTrait videoM3u8()

Video format m3u8.

Return Value

VideoFormatTrait

static VideoFormatTrait videoMpd()

Video format mpd.

Return Value

VideoFormatTrait

static VideoFormatTrait videoMkv()

Video format mkv.

Return Value

VideoFormatTrait

static VideoFormatTrait videoAvi()

Video format avi.

Return Value

VideoFormatTrait

static VideoFormatTrait video3gp()

Video format 3gp.

Return Value

VideoFormatTrait

static VideoFormatTrait video3g2()

Video format 3g2.

Return Value

VideoFormatTrait

static VideoFormatTrait videoWmv()

Video format wmv.

Return Value

VideoFormatTrait

static VideoFormatTrait videoMpeg()

Video format mpeg.

Return Value

VideoFormatTrait

static FormatTrait auto()

Auto format.

Return Value

FormatTrait

Format format(string $format)

Sets file format.

Parameters

Name Type Description
$format string The file format.

Return Value

Format

Format lossy(bool $useLossy = true)

Automatically use lossy compression when delivering animated GIF files.

Parameters

Name Type Description
$useLossy bool Indicates whether to use lossy compression.

Return Value

Format

See also

Flag::lossy

Format progressive(string $mode = null)

Applicable only for JPG file format

Parameters

Name Type Description
$mode string The mode to determine a specific progressive outcome.

Return Value

Format

See also

Flag::progressive

Format preserveTransparency()

Ensures that images with a transparency channel will be delivered in PNG format.

Return Value

Format

See also

Flag::preserveTransparency

Format ignoreMaskChannels()

Ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.

Return Value

Format

See also

Flag::ignoreMaskChannels

Constants

MAIN_QUALIFIER