diff options
Diffstat (limited to '29.md')
| -rw-r--r-- | 29.md | 43 |
1 files changed, 43 insertions, 0 deletions
| @@ -0,0 +1,43 @@ | |||
| 1 | NIP029 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | imeta | ||
| 5 | -------------- | ||
| 6 | |||
| 7 | `imeta` is a tag for adding media attachments to events. `imeta` tags MUST match URLs | ||
| 8 | in the event content. Clients may replace imeta URLs with rich previews. `imeta` tags | ||
| 9 | contain extra information about the media attachment, which clients can use to provide | ||
| 10 | a better experience when loading images. | ||
| 11 | |||
| 12 | The `imeta` tag is variadic, and each entry is a space-delimited key/value pair. | ||
| 13 | Each `imeta` tag MUST have a `url`, and at least one other field. `imeta` may include | ||
| 14 | any field specified by [NIP 94](./94.md). There SHOULD be only one `imeta` tag per url. | ||
| 15 | |||
| 16 | ## Example | ||
| 17 | |||
| 18 | ```json | ||
| 19 | { | ||
| 20 | "content": "More image metadata tests don’t mind me https://nostr.build/i/my-image.jpg", | ||
| 21 | "kind": 1, | ||
| 22 | "tags": [ | ||
| 23 | [ | ||
| 24 | "imeta", | ||
| 25 | "url https://nostr.build/i/my-image.jpg", | ||
| 26 | "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$", | ||
| 27 | "dim 3024x4032", | ||
| 28 | "alt A scenic photo overlooking the coast of Costa Rica", | ||
| 29 | "x <sha256 hash as specified in NIP 94>", | ||
| 30 | "fallback https://nostrcheck.me/alt1.jpg" | ||
| 31 | "fallback https://void.cat/alt1.jpg" | ||
| 32 | ] | ||
| 33 | ] | ||
| 34 | } | ||
| 35 | ``` | ||
| 36 | |||
| 37 | ## Recommended client behavior | ||
| 38 | |||
| 39 | When uploading images during a new post, clients MAY include this metadata | ||
| 40 | after the image is uploaded and included in the post. | ||
| 41 | |||
| 42 | When pasting urls during post composition, the client MAY download the image | ||
| 43 | and add this metadata before the post is sent. | ||