Getting Started
Installation
- 1
Install the plugin
Terminalpnpm add payload-plugin-image-cropper - 2
Install Sharp
Sharp is a peer dependency:
Terminalpnpm add sharp - 3
Register Sharp in Payload config
Pass Sharp to your Payload config so crop generation can use it:
typescriptimport sharp from 'sharp' export default buildConfig({ sharp, // ... }) - 4
Continue to Setup
Next, add the plugin to payload.config.ts and define crop fields on your collections. See Local Filesystem Storage or S3 / Cloud Storage depending on how you store media.
- 5
Or with npm
Terminalnpm install payload-plugin-image-cropper