From da66fa0f0fbfd343ded86e6acc26c102f9cfc4cf Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sun, 27 Feb 2022 15:32:06 +0100 Subject: [PATCH] Add thumbnails --- README.md | 6 +++ xep-xxxx-thumbnails.md | 88 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 README.md create mode 100644 xep-xxxx-thumbnails.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4e64f57 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Custom XEPs + +| Title | Description | +| --- | --- | +| Thumbnails | A specification for different types of thumbnails | +| File Upload Notifications | A specification for telling clients that a file will be sent as soon as it is uploaded | diff --git a/xep-xxxx-thumbnails.md b/xep-xxxx-thumbnails.md new file mode 100644 index 0000000..2a2b796 --- /dev/null +++ b/xep-xxxx-thumbnails.md @@ -0,0 +1,88 @@ +# Thumbnails +## Introduction + +When sending media, it is often helpful for users when a thumbnail can be shown before the +actual file is finished downloading. + +XMPP already has a protocol for specifying thumbails, [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html). +However, this protocol requires that the thumbnail is a base64-encoded image published using +[Bits of Binary](https://xmpp.org/extensions/xep-0231.html). This prevents clients from implementing newer technologies, such as +[Blurhash](https://github.com/woltapp/blurhash). + +This document specifies are more general and extensible element for specifiying thumbnails. + +## Usage + +``` + + LEHV6nWB2yk8pyoJadR*.7kCMdnj + +``` + +In this example, the thumbnail is specified of type `blurhash`, which means that a supporting +client should decode the `` element using the [Blurhash](https://github.com/woltapp/blurhash) algorithm. + +In order to enable a sort-of interoperability with [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html), a type +`urn:xmpp:thumbs:0` is defined. If this is specified, then a supporting client must +interpret the child of the `` as an `` element as specified by +:[Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html) + +``` + + + + + +``` + +In the case of [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html) compatibility, +the `` element must contain exactly one `` element. + +Other extensions may define similar types. Note that the content of the `` element +is dependent on the type specified in the `` +element. + +### Thumbnail Types +#### Blurhash + +If a sender specifies the type to be of `blurhash`, then the payload must contain the +image data as specified by the [Blurhash](https://github.com/woltapp/blurhash) algorithm. Care should be taken to prevent +the blurhash data from growing to large in order to prevent hitting the stanza size limit. + +## Usage with Stateless Inline Media Sharing + +NOTE: This example is taken from [Stateless Inline Media Sharing](https://xmpp.org/extensions/xep-0385.html) and modified for this protocol. + +``` + + Look at the nice view from the summit. + + + + image/jpeg + summit.jpg + 3032449 + 2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU= + 2AfMGH8O7UNPTvUVAM9aK13mpCY= + Photo from the summit. + + + + + + + LEHV6nWB2yk8pyoJadR*.7kCMdnj + + + + + + + + + +``` + +## Security Considerations + +The same considerations apply as specified by [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html).