> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Asset Library

> Reusable image library for challenges, rewards, posts — with compression and aspect-ratio support

The **Asset Library** (#1661) stores your uploaded images in one place so you can reuse them across challenges, rewards, posts, and themes — no more re-uploading the same hero image five times.

## What's in it

* Every image uploaded to the admin panel
* Organised by tag and upload date
* Searchable by filename
* Supports common image formats (including WebP)
* Recommended aspect ratios surfaced via the crop tool where applicable (#828)

***

## Uploading

Upload from any image picker in the admin — challenges, rewards, posts, theme. New uploads land in the Asset Library automatically.

### Standard aspect ratios

| Ratio          | Default use                            |
| -------------- | -------------------------------------- |
| 1:1 square     | Challenge / reward / achievement icons |
| 10:4 banner    | Community banner (#777)                |
| 16:9 landscape | Post hero, video thumbnail             |
| 4:5 portrait   | Mobile-first feed content              |

Use the crop tool to fit recommended ratios at upload time and avoid distortion at render time.

***

## Image format handling

Uploads are validated for supported file types and size limits, then stored as-is. Upload WebP yourself when you want the bandwidth savings — 30-50% smaller than PNG/JPG at equivalent quality. Automatic format conversion is not currently part of the upload pipeline.

***

## Upload reporting

Image upload success / failure is tracked (#1504) — useful for diagnosing mysterious "my image doesn't show" bugs. Upload icon overflow (#2296) was also fixed so the drag-drop target stays clickable.

***

## Background images

Backgrounds for challenges, rewards, games, and themes all go through the same uploader (#996) — consistent crop tool, consistent compression.

***

## Reuse patterns

<AccordionGroup>
  <Accordion title="Per-series banners" icon="photo-film">
    Upload a banner for a challenge series; reuse on each challenge in the series. Visual coherence without re-uploads.
  </Accordion>

  <Accordion title="Theme asset set" icon="palette">
    Upload your brand's logo, hero, and accent images once. Reference from both the theme and individual content.
  </Accordion>

  <Accordion title="Reward art" icon="gift">
    Upload a set of reward images (e.g. four tiered prize visuals). Reuse on tiered rewards, tiered achievements, tiered leaderboards.
  </Accordion>
</AccordionGroup>

***

## API

* `POST /api/files/upload` — upload an image (multipart form field `file`)
* `DELETE /api/files/upload?url=<blob-url>` — delete a previously uploaded image by its public blob URL (Admin+ only)

Both routes are auth-gated via the admin session. Library listing/browsing is handled by the admin UI on top of Vercel Blob — there is no public "list assets" endpoint.
