# Extensible File 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 in various formats. ## Usage ```xml LEHV6nWB2yk8pyoJadR*.7kCMdnj ``` This example specifies a thumbnail of type `blurhash`, meaning that the child element of the `` element must contain a `` element (See "Thumbnail Types"). ### Thumbnail Types #### Blurhash If a sender specifies the type of the `` element to be `proto:urn:xmpp:eft:0:blurhash`, then the `` element's value must be interpreted as [Blurhash](https://github.com/woltapp/blurhash) data. As a sender, care must be taken to not make the Blurhash thumbnail too big as to not loose the advantages of Blurhash. ```xml LEHV6nWB2yk8pyoJadR*.7kCMdnj ``` #### Jingle Content Thumbnail Compatability In order to enable a pseudo-interoperability with [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html), inclusion of a `` element is allowed. This is to allow easy reuse of an already existent [Jingle Content Thumbnails](https://xmpp.org/extensions/xep-0264.html) implementation. The type of the `` must then be set to `proto:urn:xmpp:eft:0:base64-bob`. ```xml ``` ## Usage Example 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. ```xml 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). ## Todo - Change XML namespace from `proto:urn:xmpp:eft:0` to `urn:xmpp:eft:0` once we submit this as an XEP ## Changelog ### 0.2.0 - Namespace the thumbnail type - `` to `` ### 0.1.0 - Remove the base64 thumbnail type - Namespace all thumbnail types - Remove the type attribute of `` - Rename `` to `` - Rename the namespace from file-thumbnails to eft - Rename from File Thumbnails to Extensible File Thumbnails ## Info | Key | Value | | --- | --- | | Author | PapaTutuWawa | | Version | 0.2.0 | | Short name | eft |