From 2c016b0659a8f29ad2420a4cd844a2dca4956407 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 27 Nov 2023 14:47:04 -0800 Subject: [PATCH] Add imeta tag --- 29.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 94.md | 1 + 2 files changed, 44 insertions(+) create mode 100644 29.md diff --git a/29.md b/29.md new file mode 100644 index 0000000..8c990bb --- /dev/null +++ b/29.md @@ -0,0 +1,43 @@ +NIP029 +====== + +imeta +-------------- + +`imeta` is a tag for adding media attachments to events. `imeta` tags MUST match URLs +in the event content. Clients may replace imeta URLs with rich previews. `imeta` tags +contain extra information about the media attachment, which clients can use to provide +a better experience when loading images. + +The `imeta` tag is variadic, and each entry is a space-delimited key/value pair. +Each `imeta` tag MUST have a `url`, and at least one other field. `imeta` may include +any field specified by [NIP 94](./94.md). There SHOULD be only one `imeta` tag per url. + +## Example + +```json +{ + "content": "More image metadata tests don’t mind me https://nostr.build/i/my-image.jpg", + "kind": 1, + "tags": [ + [ + "imeta", + "url https://nostr.build/i/my-image.jpg", + "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$", + "dim 3024x4032", + "alt A scenic photo overlooking the coast of Costa Rica", + "x ", + "fallback https://nostrcheck.me/alt1.jpg" + "fallback https://void.cat/alt1.jpg" + ] + ] +} +``` + +## Recommended client behavior + +When uploading images during a new post, clients MAY include this metadata +after the image is uploaded and included in the post. + +When pasting urls during post composition, the client MAY download the image +and add this metadata before the post is sent. diff --git a/94.md b/94.md index eb8117a..e35dfa1 100644 --- a/94.md +++ b/94.md @@ -25,6 +25,7 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr * `image` (optional) url of preview image with same dimensions * `summary` (optional) text excerpt * `alt` (optional) description for accessibility +* `fallback` (optional) zero or more fallback file sources in case `url` fails ```json {