From 606b3aae900bf14821a14d8aeb23ce2c7cdebf04 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 28 Feb 2022 20:43:30 +0100 Subject: [PATCH] Update file-thumbnails - Remove the namespaced versions of the thumbnail types - Add the "base64" and "base64-bob" types --- xep-xxxx-file-thumbnails.md | 70 +++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/xep-xxxx-file-thumbnails.md b/xep-xxxx-file-thumbnails.md index 6b05ec4..59e9abc 100644 --- a/xep-xxxx-file-thumbnails.md +++ b/xep-xxxx-file-thumbnails.md @@ -14,7 +14,7 @@ This document specifies are more general and extensible element for specifiying ## Usage ```xml - + LEHV6nWB2yk8pyoJadR*.7kCMdnj ``` @@ -22,33 +22,59 @@ This document specifies are more general and extensible element for specifiying In this example, the thumbnail is specified of type `proto:urn:xmpp:file-thumbnails:0: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 -`proto:urn:xmpp:file-thumbnails:0:jct` is defined. - -```xml - - - -``` - -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. +is dependent on the type specified in the `` element. ### Thumbnail Types #### Blurhash -If a sender specifies the type to be of `proto:urn:xmpp:file-thumbnails:0:blurhash`, then the `` element must contain the +If a sender specifies the type to be of `blurhash`, then the `` element 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. +```xml + + LEHV6nWB2yk8pyoJadR*.7kCMdnj + +``` + #### Jingle Content Thumbnail Compatability -If a sender specified the type to be of `proto:urn:xmpp:file-thumbnails:0:jct`, then the `` -element must contain exactly one `` element. +In order to enable a pseudo-interoperability with [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html), a type +`base64-bob` is defined. + +If a sender specified the type to be of `base64-bob`, then the `` +element must contain exactly one `` element. The attributes of the element are the same +as the `` element specified in [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html). + +```xml + + + +``` + +This allows clients that already support [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html) to reuse +the same logic they use for retrieving thumbnail data. + +#### Base64 Data + +If a sender specified the type to be of `base64`, then the `` element must +contain exactly one `` element. The element must posess an `media-type` attribute, whose value +contains the mime type of the thumbnail data, while the inner text of the element contains the base64-encoded +binary thumbnail data. + +```xml + + + [base64 data] + + +``` + +Note that this thumbnail type is essentially the same as the `base64-bob` type, but allowing the thumbnail to be used even if +the sender is not available on a server that does not cache [Bits of Binary](https://xmpp.org/extensions/xep-0231.html) data or has it otherwise not available. + +If using this thumbnail type, care has to be taken in order to not hit any existing stanza size limits. ## Usage Example with Stateless Inline Media Sharing @@ -66,10 +92,10 @@ NOTE: This example is taken from [Stateless Inline Media Sharing](https://xmpp.o 2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU= 2AfMGH8O7UNPTvUVAM9aK13mpCY= Photo from the summit. - - + + - + LEHV6nWB2yk8pyoJadR*.7kCMdnj @@ -91,4 +117,4 @@ The same considerations apply as specified by [Jingle Content Thumbnails](https: | Key | Value | | --- | --- | | Author | PapaTutuWawa | -| Version | 0.0.2 | +| Version | 0.0.3 |