Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Blossom Servers expose a few endpoints for managing blobs

- `PUT /report` [BUD-09](./buds/09.md)

- `GET /thumb/<sha256>` (optional file `.ext`) [BUD-10](./buds/10.md)

## Protocol specification (BUDs)

BUDs stand for **Blossom Upgrade Documents**.
Expand Down
23 changes: 23 additions & 0 deletions buds/10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# BUD-10

## Thumbnails

`draft` `optional`

To optimize image and video previews servers MAY implement this endpoint which is used to generate thumbnails.

## `GET /thumb/{sha256}[.{ext}]`

This endpoint will return a scaled down frame of the media and can be used to preview the content without downloading the entire file.

This is usefull for media browsing and management of media hosted on the server via `GET /list/{pubkey}` and `DELETE /{sha256}`.

The returned frame should be any supported `image/*` type with the same aspect ratio as the source material.

Servers MAY use the `.{ext}` in the URL or the `Accept` HTTP request header to determine which image format to generate.

The suggested scaling operation is to fix the width to 512 pixels.

Servers MAY also include the [NIP-94](https://github.com/nostr-protocol/nips/blob/master/94.md) tag `thumb` as indicated in [BUD-08](./08.md)

If the blob is not an image or video the server SHOULD reply with a `400` error code.