| 1 | /** |
| 2 | * Content types accepted for an avatar upload, mapped to the stored extension. |
| 3 | * |
| 4 | * No WebP: avatars are drawn into the OG images and `next/og` cannot decode it. |
| 5 | */ |
| 6 | export const AVATAR_CONTENT_TYPES = |
| 7 | 'image/png': 'png', |
| 8 | 'image/jpeg': 'jpg', |
| 9 | } as const; |
| 10 | |
| 11 | export type AvatarContentType |
| 12 | |
| 13 | /** Upload ceiling. The client resizes to a 256px square before sending, so this is generous - it only exists so an unresized original cannot fill the bucket. */ |
| 14 | export const AVATAR_MAX_BYTES = |
| 15 | |
| 16 | /** Bucket prefix every avatar object lives under. */ |
| 17 | export const AVATAR_PREFIX = |
| 18 | |
| 19 | /** Object names this service generates: `<nanoid>.<extension>`. */ |
| 20 | export const AVATAR_NAME_PATTERN = |