Skip to content

Tankōbon / lib/cover-crop / cropToCover

Function: cropToCover() ​

cropToCover(source, rect): Promise<Uint8Array<ArrayBufferLike>>

Defined in: lib/cover-crop.ts:51

Draws rect of source into a COVER_OUTPUT_WIDTH × COVER_OUTPUT_HEIGHT canvas and encodes it as WebP. Rejects when the canvas or the encoding is unavailable.

Parameters ​

source ​

ImageBitmap

rect ​

SourceRect

Returns ​

Promise<Uint8Array<ArrayBufferLike>>