BeechCMS / @beechcms/core / IImageTransformer
Interface: IImageTransformer
Port for edge image transformation. The API injects a Cloudflare Images adapter when the IMAGES binding exists and null otherwise; handlers never see the binding itself.
Methods
probe()
probe(
source):Promise<MediaDimensions>
Reads the source's pixel dimensions. Rejects when the stream is not a raster image.
Parameters
source
ReadableStream<Uint8Array<ArrayBufferLike>>
Returns
Promise<MediaDimensions>
transform()
transform(
source,spec):Promise<TransformedImage>
Applies the spec and returns the encoded variant.
Parameters
source
ReadableStream<Uint8Array<ArrayBufferLike>>
spec
Returns
Promise<TransformedImage>