Skeudenn / main/services/thumbnail-cache / renderThumbnail
Function: renderThumbnail() ​
renderThumbnail(
image):Promise<Uint8Array<ArrayBuffer>>
Defined in: src/main/services/thumbnail-cache.ts:34
Shrinks an image (any format @napi-rs/canvas decodes: JPEG, PNG, WebP, GIF, AVIF…) to fit in THUMBNAIL_MAX_WIDTH × THUMBNAIL_MAX_HEIGHT, keeping its aspect ratio and never enlarging it, and encodes it as WebP. Rejects an image declaring more than MAX_IMAGE_PIXELS, before decoding it.
Parameters ​
image ​
Uint8Array
Returns ​
Promise<Uint8Array<ArrayBuffer>>