Tankōbon / lib/avatar / shrinkAvatar
Function: shrinkAvatar()
shrinkAvatar(
bytes):Promise<Uint8Array<ArrayBufferLike>>
Defined in: lib/avatar.ts:22
Turns the bytes of a picked picture (PNG, JPEG or WebP) into a square WebP of AVATAR_SIZE px, centred on the picture, small enough for users:set-avatar. Rejects when the browser can't decode the file.
Parameters
bytes
Uint8Array
Returns
Promise<Uint8Array<ArrayBufferLike>>