Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122import {reencodeWebp, type ProcessedImage} from './image'
const AVATAR_SIZE = 512const MAX_INPUT_BYTES = 6 * 1024 * 1024
export {InvalidImageError} from './image'
// re-encode to a square webp — neutralizes crafted payloads, strips exif,// normalizes sizeexport const processAvatar = ( input: Uint8Array,): Promise<ProcessedImage> => reencodeWebp(input, { width: AVATAR_SIZE, height: AVATAR_SIZE, fit: 'cover', maxInputBytes: MAX_INPUT_BYTES, })
export const avatarKey = (userId: string, hash: string) => `avatars/${userId}/${hash}.webp`