mirror of
https://github.com/nostr-protocol/nips.git
synced 2026-10-05 18:58:44 +00:00
NIP-92: imeta tags for kind 0 picture and banner (#2494)
This commit is contained in:
@@ -14,7 +14,7 @@ These are extra fields not specified in NIP-01 that may be present in the string
|
||||
|
||||
- `display_name`: an alternative, bigger name with richer characters than `name`. `name` should always be set regardless of the presence of `display_name` in the metadata.
|
||||
- `website`: a web URL related in any way to the event author.
|
||||
- `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen.
|
||||
- `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen. It MAY be described by an `imeta` tag as in [NIP-92](92.md#profile-metadata).
|
||||
- `bot`: a boolean to clarify that the content is entirely or partially the result of automation, such as with chatbots or newsfeeds.
|
||||
- `birthday`: an object representing the author's birth date. The format is { "year": number, "month": number, "day": number }. Each field MAY be omitted.
|
||||
|
||||
|
||||
@@ -43,3 +43,38 @@ When pasting URLs during post composition, the client MAY download the file
|
||||
and add this metadata before the post is sent.
|
||||
|
||||
The client MAY ignore `imeta` tags that do not match the URL in the event content.
|
||||
|
||||
## Profile metadata
|
||||
|
||||
A kind `0` event MAY carry `imeta` tags describing the images named by the `picture` and `banner` fields of its stringified JSON content ([NIP-01](01.md), [NIP-24](24.md)). This gives profile images the same `fallback`, `blurhash`, `dim`, `alt`, and other [NIP-94](94.md) fields available to any other attachment.
|
||||
|
||||
An `imeta` tag describes a field only when its `url` is exactly equal to that field's value. Tags whose `url` matches neither field SHOULD be ignored.
|
||||
|
||||
```json
|
||||
{
|
||||
"kind": 0,
|
||||
"content": "{\"name\":\"luna\",\"picture\":\"https://blossom.example/1f2e...a9.jpg\",\"banner\":\"https://blossom.example/7c3d...04.webp\"}",
|
||||
"tags": [
|
||||
[
|
||||
"imeta",
|
||||
"url https://blossom.example/1f2e...a9.jpg",
|
||||
"m image/jpeg",
|
||||
"x 1f2e...a9",
|
||||
"dim 400x400",
|
||||
"blurhash LEHV6nWB2yk8pyo0adR*.7kCMdnj",
|
||||
"fallback https://mirror.example/1f2e...a9.jpg"
|
||||
],
|
||||
[
|
||||
"imeta",
|
||||
"url https://blossom.example/7c3d...04.webp",
|
||||
"m image/webp",
|
||||
"x 7c3d...04",
|
||||
"dim 1500x500"
|
||||
]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Clients SHOULD try the declared `fallback` URLs when the primary URL fails to load.
|
||||
|
||||
Since kind `0` is replaceable, clients publishing a new kind `0` SHOULD carry over the `imeta` tags for a `picture` or `banner` that hasn't changed, and drop the tags for images that are no longer in use.
|
||||
|
||||
Reference in New Issue
Block a user