ImageTransformPreset

ImageTransformPreset

ImageTransformPreset

A configuration option for an image size preset for the AssetServerPlugin.

Presets allow a shorthand way to generate a thumbnail preview of an asset. For example, the built-in “tiny” preset generates a 50px x 50px cropped preview, which can be accessed by appending the string preset=tiny to the asset url:

http://localhost:3000/assets/some-asset.jpg?preset=tiny

is equivalent to:

http://localhost:3000/assets/some-asset.jpg?w=50&h=50&mode=crop

Signature

interface ImageTransformPreset {
  name: string;
  width: number;
  height: number;
  mode: ImageTransformMode;
}

Members

name

property
type:
string

width

property
type:
number

height

property
type:
number

mode

property