2.0.2 • Published 3 months ago

payload-blurhash-plugin v2.0.2

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 months ago

payload-blurhash-plugin

Payload CMS plugin for automatic Blurhash encoding of images.

Getting started

  1. Install the package with npm i payload-blurhash-plugin or yarn add payload-blurhash-plugin.
  2. Add the plugin to your payload.config.ts:
import computeBlurhash from 'payload-blurhash-plugin';

export default buildConfig({
  /* ... */
  plugins: [
    computeBlurhash(),
  ],
});

Plugin options

Optionally, you can pass the following options to tweak the behavior of the plugin:

export interface BlurhashPluginOptions {
  /*
   * Array of collection slugs that the plugin should apply to.
   * By default, the plugin will apply to all collections with `upload` properties.
   */
  collections?: CollectionConfig['slug'][];

  /*
   * Width to resize the image to prior to computing the blurhash.
   * Default: 32
   */
  width?: number;

  /*
   * Height to resize the image to prior to computing the blurhash.
   * Default: 32
   */
  height?: number;

  /*
   * X component count to pass to the Blurhash library.
   * Default: 3
   */
  componentX?: number;

  /*
   * Y component count to pass to the Blurhash library.
   * Default: 3
   */
  componentY?: number;
}

The defaults are chosen somewhat arbitrarily, they are just values that I've found to work nicely for me.

2.0.2

3 months ago

2.0.1

3 months ago

1.3.1

6 months ago

1.3.0

6 months ago

2.0.0

6 months ago

1.2.0

1 year ago

1.0.3

2 years ago

1.0.3-alpha.1

2 years ago

1.0.3-alpha.0

2 years ago

1.0.3-0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago