Skeudenn / lib/cover-crop / cropToCover
Function: cropToCover() ​
cropToCover(
source,rect):Promise<Uint8Array<ArrayBufferLike>>
Defined in: src/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 ​
Returns ​
Promise<Uint8Array<ArrayBufferLike>>