[]previous and next page

sharpProcessor

A processor that resizes and converts raster images with sharp.

A processor that resizes and converts raster images with sharp. An SVG, or a source format it does not encode (GIF, TIFF) under f=original, is returned unchanged: the endpoint then serves the source at its own size.

Import#

ts
import { sharpProcessor } from "@shadow-js/dusk/server";

Signature#

ts
function sharpProcessor(options: SharpProcessorOptions = {}): ImageProcessor

Parameters#

Name Description
options The factory (for a test or an app that loads sharp itself).

Returns#

A processor for createHandler({ images: { processor } }).

Examples#

ts
createHandler({ manifest, features: [pages(), images()], images: { processor: sharpProcessor(), remotePatterns: ["https://cdn.example"] } });