# 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 ``` In this example, the thumbnail contains only a blurhash thumbnail, indicated by the `` element, but an implementation may add more versions of the same thumbnail, i.e. another `` element as a fallback if a client does not support blurhash. To prevent confusion in the display of a thumbnail, all children of `` must describe a thumbnail for the same file. ### Thumbnail Types #### Blurhash If a sender includes a `` inside the `` element, then it 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. ```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.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.1.0 | | Short name | eft |