diff --git a/24.md b/24.md index 0094d58d..4dd45c0c 100644 --- a/24.md +++ b/24.md @@ -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. diff --git a/92.md b/92.md index 14902c31..22a9e96e 100644 --- a/92.md +++ b/92.md @@ -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.