Thu, 3 Sep 2015 14:11:32 +0300 Evgeny Khramtsov <xramt...@gmail.com> wrote:
> It would be great if the protocol supports image thumbnails > (optionally). A server could generate thumbnails during upload so a > client don't need to convert image locally. This will reduce > cpu/battery usage on mobile devices, simplify clients code and will > prevent UI from freezing during image transformation). I think > there are two ways implementing it: > > 1) The thumbnail SHOULD be returned with HTTP response, e.g.: > HTTP/1.1 200 OK > Content-Type: text/xml > ... > <thumbnail xmlns='urn:xmpp:thumbs:1' > > uri='https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/thumb.png' > media-type='image/png' > width='128' > height='96'/> > > (the <thumnail/> element is described in XEP-0264) > > 2) Another way is introducing new stanza which will be sent by an XMPP > server when upload is complete, for example: > > <iq from='upload.montague.tld > id='step_03' > to='ro...@montague.tld/garden > type='set'> > <response xmlns='urn:xmpp:http:upload'> > <thumbnail xmlns='urn:xmpp:thumbs:1' > > uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org' > media-type='image/png' > width='128' > height='96'/> > </response> > </iq> > > Also, <response/> element could be extended to notify a client about > upload status. > > This thumbnail then can be put into file-transfer offer using either > jingle http transport protoXEP or directly into jabber:x:oob message, > e.g: > > <message > from='co...@chat.shakespeare.lit/firstwitch' > id='162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2' > to='hec...@shakespeare.lit/broom' > type='groupchat'> > > <body>https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/my_juliet.png</body> > <x xmlns='jabber:x:oob'> > > <url>https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/my_juliet.png</url> > <desc>file</desc> > <thumbnail xmlns='urn:xmpp:thumbs:1' > > uri='https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/thumb.png' > media-type='image/png' > width='128' > height='96'/> > > </x> > </message> XSF guys, any repsonse on this? I could make a PR based on the way we choose.