Abstract: | This specification defines a way for a client to supply a preview image for Jingle content. |
Authors: | Marcus Lundblad, Lance Stout |
Copyright: | © 1999 - 2016 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.4 |
Last Updated: | 2015-08-26 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Requirements
3. Use Cases
4. Definition of the thumbnail Element
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
7.1. Protocol Namespaces
7.2. Protocol Versioning
8. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
When offering a Jingle session, it can be helpful to provide a small preview of the offered content to help the session responder decide whether to accept or reject the session.
This is particularly useful for file transfer content (especially image files), but can also be used for things such as video (e.g. using a still frame from the stream as the preview thumbnail), and even audio by using a small image of album cover art.
This documents defines a way to include a thumbnail image as an additional metadata in a Jingle content description.
When a client wishes to supply a thumbnail in a content offer, it can do so by including an extra <thumbnail/> element as shown in the following example:
<iq from='romeo@montague.lit/orchard' id='nzu25s8' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:0' action='session-initiate' initiator='romeo@montague.lit/orchard' sid='851ba2'> <content creator='initiator' name='a-file-offer'> <description xmlns='urn:xmpp:jingle:apps:file-transfer:4' senders='initiator'> <file> <media-type>image/jpeg</media> <name>image.jpg</name> <size>3032449</size> <hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash> <desc>This is a test. If this were a real file...</desc> <thumbnail xmlns='urn:xmpp:thumbs:1' uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org' media-type='image/png' width='128' height='96'/> </file> </description> <transport .../> </content> </jingle> </iq>
Thumbnails MAY be included for Jingle content other than file transfer. For example, with Jingle RTP video a thumbnail could be included to show who is calling (either by capturing a still frame from the input stream or by using an existing profile image):
<iq from='romeo@montague.lit/orchard' id='ih28sx61' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='session-initiate' initiator='romeo@montague.lit/orchard' sid='a73sjjvkla37jfea'> <content creator='initiator' name='webcam'> <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'> <payload-type id='98' name='theora' clockrate='90000'> <parameter name='height' value='600'/> <parameter name='width' value='800'/> <parameter name='delivery-method' value='inline'/> <parameter name='configuration' value='somebase16string'/> <parameter name='sampling' value='YCbCr-4:2:2'/> </payload-type> <payload-type id='28' name='nv' clockrate='90000'/> <payload-type id='25' name='CelB' clockrate='90000'/> <payload-type id='32' name='MPV' clockrate='90000'/> <bandwidth type='AS'>128</bandwidth> <thumbnail xmlns='urn:xmpp:thumbs:1' uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org' media-type='image/png' width='128' height='96'/> </description> <transport .../> </content> </jingle> </iq>
Multiple <thumbnail/> elements MAY be included to provide thumbnails of different sizes, media types, or URIs.
If the provided URI has the scheme 'cid', then the thumbnail data MAY be requested using Bits of Binary (XEP-0231) [1].
The following attributes are defined for the <thumbnail/> element.
Attribute | Description | Inclusion |
---|---|---|
uri | A URI where the thumbnail data can be accessed (typically by using a URI scheme of 'cid:', 'https:', or 'http:'). If the URI scheme is 'cid:' then the identifier MUST refer to a bit of binary data as described in Bits of Binary (XEP-0231) [2] | REQUIRED |
media-type | The value of the 'media-type' attribute MUST match the syntax specified in RFC 2045 [3]. That is, the value MUST include a top-level media type, the "/" character, and a subtype; in addition, it MAY include one or more optional parameters. The "type/subtype" string SHOULD be registered in the IANA MIME Media Types Registry [4], but MAY be an unregistered or yet-to-be-registered value. | RECOMMENDED |
width | The intended display width of the thumbnail image. Used as a hint for the receiving client to prepare the appropriate UI, such as a dialog window. | OPTIONAL |
height | The intended display height of the thumbnail image. Used as a hint for the receiving client to prepare the appropriate UI, such as a dialog window. | OPTIONAL |
The inclusion of an image thumbnail may leak information about a transfer otherwise taking place on an e2e encrypted file transfer stream. A client MAY wish to not include a thumbnail.
A client MUST NOT rely on the values specified for the width and height of a thumbnail to allocate a bitmap data buffer for the thumbnail, to prevent possible DoS attacks. Also a client SHOULD apply implementation-specific limits on the thumbnails, if using these values to pepare a UI element for the thumbnail image, e.g. with dimensions of 128x128 pixels, values exceeding these would then be truncated and the thumbnail image scaled down when received.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
This specification defines the following XML namespace:
The XMPP Registrar [6] includes this namespace in the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [7].
If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:thumbs:0' xmlns='urn:xmpp:thumbs:0' elementFormDefault='qualified'> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in xxx </xs:documentation> </xs:annotation> <xs:element name='thumbnail'> <xs:complexType> <xs:attribute name='uri' type='xs:anyURI' use='required'/> <xs:attribute name='media-type' type='xs:string' use='optional'/> <xs:attribute name='width' type='xs:integer' use='optional'/> <xs:attribute name='height' type='xs:integer' use='optional'/> </xs:complexType> </xs:element> </xs:schema>
Series: XEP
Number: 0264
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.4
Last Updated: 2015-08-26
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0096, XEP-0231
Supersedes: None
Superseded By: None
Short Name: thumbs
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
ml@update.uu.se
JabberID:
mlundblad@jabber.org
Email:
lance@andyet.com
JabberID:
lance@lance.im
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0231: Bits of Binary <http://xmpp.org/extensions/xep-0231.html>.
2. XEP-0231: Bits of Binary <http://xmpp.org/extensions/xep-0231.html>.
3. RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies <http://tools.ietf.org/html/rfc2045>.
4. IANA registry of MIME media types <http://www.iana.org/assignments/media-types>.
5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
6. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
7. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Changed format to use generic 'uri' attribute to allow for 'https:' and 'http:' URIs in addition to BoB 'cid:' URIs.
Indicated that multiple thumbnails may be present.
Expanded scope of use cases to be Jingle content in general, not just file transfer.
(ljts)Fixed typo in author's name :).
(ml)Add paragraph in security section about protecting against malicious thumbnail dimensions in offer. Fixed a typo.
(ml)Initial published version.
(psa)Split use-case section into "Introduction", "Requirements", and "Use case".
(ml)Removed service disovery. Added missing namespace on thumnail elements.
(ml)First draft.
(ml)END