| Abstract: | This specification defines a way for a client supply a preview image for a file transfer. |
| Author: | Marcus Lundblad |
| Copyright: | © 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Deferred |
| Type: | Standards Track |
| Version: | 0.3 |
| Last Updated: | 2009-04-27 |
WARNING: Consideration of this document has been Deferred by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended.
1. Introduction
2. Requirements
3. Use Case
3.1. Definition of the thumbnail Element
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
6.1. Protocol Namespaces
6.2. Protocol Versioning
7. 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
The current methods for file transfers include basic meta data about the file being offered (name, size, and date). There currently is no way to provide an image thumbnail for files such as photos.
This documents defines a way to include a thumbnail image as an additional metadata in a file transfer.
When a client wishes to supply a thumbnail in a transfer offer, it can do so by including an extra <thumbnail/> element as shown in the following exaples.
Example 1. Inclusion of a thumbnail in SI file transfer offer
<iq type='set' id='offer1' to='receiver@jabber.org/resource'>
<si xmlns='http://jabber.org/protocol/si'
id='a0'
mime-type='image/jpeg'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='image.jpg'
size='3032449'>
<thumbnail xmlns='urn:xmpp:thumbs:0'
cid='sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org'
mime-type='image/png'
width='128'
height='96'/>
</file>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='stream-method' type='list-single'>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
</field>
</x>
</feature>
</si>
</iq>
The receiver MAY now request the data using the protocol defined in Bits of Binary [1].
Example 2. Inclusion of a thumbnail in a Jingle file transfer offer
<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:1'>
<offer>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='image.jpg'
size='3032449'
hash='552da749930852c69ae5d2141d3766b1'
date='1969-07-21T02:56:15Z'>
<desc>This is a test. If this were a real file...</desc>
<thumbnail xmlns='urn:xmpp:thumbs:0'
cid='sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org'
mime-type='image/png'
width='128'
height='96'/>
</file>
</offer>
</description>
...
</content>
</jingle>
</iq>
The following attributes are defined for the <thumbnail/> element.
Table 1: Attributes of the thumbnail Element
| Attribute | Description | Inclusion |
|---|---|---|
| cid | A Content-ID that can be mapped to a cid: URL as specified in RFC 2111 [2]. The 'cid' value SHOULD be of the form algo+hash@bob.xmpp.org, where the "algo" is the hashing algorithm used (e.g., "sha1" for the SHA-1 algorithm as specified in RFC 3174 [3]) and the "hash" is the hex output of the algorithm applied to the binary data itself. | REQUIRED |
| mime-type | The value of the 'mime-type' attribute MUST match the syntax specified in RFC 2045 [4]. 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 (e.g., the "audio/ogg" MIME type in the example shown below includes a "codecs" parameter as specified in RFC 4281 [5]). The "type/subtype" string SHOULD be registered in the IANA MIME Media Types Registry [6], 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 i.e. a dialog window. | OPTIONAL |
| height | The intended display height of the thumbnail image. Used as a hint for the receiving client to prepare i.e. 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, of f.ex. 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) [7].
This specification defines the following XML namespace:
The XMPP Registrar [8] includes this namespace in the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function [9].
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='cid' type='xs:string' use='required'/>
<xs:attribute name='mime-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:
Deferred
Type:
Standards Track
Version: 0.3
Last Updated: 2009-04-27
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
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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. RFC 2111: Content-ID and Message-ID Uniform Resource Locators <http://tools.ietf.org/html/rfc2111>.
3. RFC 3174: US Secure Hash Algorithm 1 (SHA1) <http://tools.ietf.org/html/rfc3174>.
4. RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies <http://tools.ietf.org/html/rfc2045>.
5. RFC 4281: The Codecs Parameter for "Bucket" Media Types <http://tools.ietf.org/html/rfc4281>.
6. IANA registry of MIME media types <http://www.iana.org/assignments/media-types>.
7. 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/>.
8. 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/>.
9. 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/
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