Skip to content

ImageTransforms ​

Type
Class
Namespace
craft\mcp\capabilities
Inherits
craft\mcp\capabilities\ImageTransforms
Since
5.12.0

View source

Public Methods ​

MethodDescription
__construct()
create()
delete()
get()
list()
update()

__construct() ​

View source

Arguments ​

  • $imageTransforms

create() ​

View source

Arguments ​

  • $name
  • $handle
  • $width (integer, null) – Transform width.
  • $height (integer, null) – Transform height.
  • $format (string, null) – Output format.
  • $quality (integer, null) – Output quality.
  • $mode (string) – Transform mode.
  • $position (string) – Crop or fit position.
  • $interlace (string) – Interlace mode.
  • $fill (string, null) – Fill color for letterbox mode.
  • $upscale (boolean) – Whether images can be upscaled.

Returns ​

array{transform: array<string,mixed>}

delete() ​

View source

Arguments ​

  • $id
  • $uid
  • $handle

Returns ​

array{deleted: true}

get() ​

View source

Arguments ​

  • $id
  • $uid
  • $handle

Returns ​

array{transform: array<string,mixed>}

list() ​

View source

Returns ​

array{count: int, transforms: list<array<string,mixed>>}

update() ​

View source

Arguments ​

  • $context
  • $id
  • $uid
  • $currentHandle (string, null) – Existing image transform handle.
  • $name
  • $handle (string, null) – New transform handle.
  • $width (integer, null) – Transform width.
  • $height (integer, null) – Transform height.
  • $format (string, null) – Output format.
  • $quality (integer, null) – Output quality.
  • $mode (string) – Transform mode.
  • $position (string) – Crop or fit position.
  • $interlace (string) – Interlace mode.
  • $fill (string, null) – Fill color for letterbox mode.
  • $upscale (boolean) – Whether images can be upscaled.

Returns ​

array{transform: array<string,mixed>}