[jitsi-dev] Avatar images from XCAP


#1

Hi,

At the moment Jitsi accepts it's own (SIP registered account) Avatar image
as "application/vnd.oma.pres-content+xml" document with base64 encoded image.

On the other hand Avatar images for contacts are only accepted as raw PNG data.

Please see PDF below for more details:

http://dl.dropbox.com/u/3182365/Jitsi-avatar-images.pdf

IMHO the former (icon as raw PNG image in response to:
GET /oma_status-icon/users/sip:user@sip.domain/sip_communicator)
is the correct behaviour and should be used in both cases.

Regards,
Chris


#2

Hi,

I'm not sure is there any rfc for this and which is it, but I see that
using vnd.oma.pres-content+xml content type is when you want to put
your avatar on xcap server. ( http://openxcap.org/wiki/Icon ).
You mean that account avatar is retrieved differently than the contact
avatars? You see some problem in this or its not working?

Currently I can see when starting Jitsi that my avatar is retrieved
with http request :
GET /xcap-root/oma_status-icon/users/sip:myUser@my_server/sip_communicator

Thanks
damencho

···

On Mon, Aug 8, 2011 at 12:00 AM, Chris Maciejewski <chris@wima.co.uk> wrote:

Hi,

At the moment Jitsi accepts it's own (SIP registered account) Avatar image
as "application/vnd.oma.pres-content+xml" document with base64 encoded image.

On the other hand Avatar images for contacts are only accepted as raw PNG data.

Please see PDF below for more details:

http://dl.dropbox.com/u/3182365/Jitsi-avatar-images.pdf

IMHO the former (icon as raw PNG image in response to:
GET /oma_status-icon/users/sip:user@sip.domain/sip_communicator)
is the correct behaviour and should be used in both cases.

Regards,
Chris


#3

Hi,

When you PUT an image you send XML document mime type:
"vnd.oma.pres-content+xml" with base64 encoded PNG. But when you GET
an image (from the same URL where you PUTed it), XCAP server should
return a raw PNG image mime type: image/png.

See, this has been fixed in the OpenXCAP release 1.2.0:

http://www.ag-projects.com/news-corporate-201/613-new-openxcap-release-120

"Icon application GET returns the image itself, not an XML"

I think the problem originates in Jitsi using:

impl/protocol/sip/OperationSetServerStoredAccountInfoSipImpl.java line 458:

ContentType presContent = xCapClient.getPresContent(
                    ProtocolProviderServiceSipImpl.PRES_CONTENT_IMAGE_NAME);

(XML document)

vs

impl/protocol/sip/OperationSetPresenceSipImpl.java line 2709:

newImage = xCapClient.getImage(imageUri);

(raw PNG image)

Best regards,
Chris

···

On 8 August 2011 08:52, Damian Minkov <damencho@jitsi.org> wrote:

Hi,

I'm not sure is there any rfc for this and which is it, but I see that
using vnd.oma.pres-content+xml content type is when you want to put
your avatar on xcap server. ( http://openxcap.org/wiki/Icon ).
You mean that account avatar is retrieved differently than the contact
avatars? You see some problem in this or its not working?

Currently I can see when starting Jitsi that my avatar is retrieved
with http request :
GET /xcap-root/oma_status-icon/users/sip:myUser@my_server/sip_communicator

Thanks
damencho


#4

Hi again,

Hi,

When you PUT an image you send XML document mime type:
"vnd.oma.pres-content+xml" with base64 encoded PNG. But when you GET
an image (from the same URL where you PUTed it), XCAP server should
return a raw PNG image mime type: image/png.

Our own avatar is get with the url I already mentioned (GET
/xcap-root/oma_status-icon/users/sip:myUser@my_server/sip_communicator)
and the content that server returns is a PNG, only the server reports
it as content-type:application/vnd.oma.pres-content+xml, but that's
not our problem.

See, this has been fixed in the OpenXCAP release 1.2.0:

http://www.ag-projects.com/news-corporate-201/613-new-openxcap-release-120

"Icon application GET returns the image itself, not an XML"

Yes we get the image (not a xml with base64 image) and I can see it
next to our name and status. I'm testing with openxcap 2.0.1.

You mean its not working in older releases or what? Sorry I cannot
really get what the problem is, cause I currently see the requests and
results through a wireshark dump and they are as you describe them :slight_smile:

Regards
damencho

···

On Mon, Aug 8, 2011 at 11:05 AM, Chris Maciejewski <chris@wima.co.uk> wrote:

I think the problem originates in Jitsi using:

impl/protocol/sip/OperationSetServerStoredAccountInfoSipImpl.java line 458:

ContentType presContent = xCapClient.getPresContent(
ProtocolProviderServiceSipImpl.PRES_CONTENT_IMAGE_NAME);

(XML document)

vs

impl/protocol/sip/OperationSetPresenceSipImpl.java line 2709:

newImage = xCapClient.getImage(imageUri);

(raw PNG image)

Best regards,
Chris

On 8 August 2011 08:52, Damian Minkov <damencho@jitsi.org> wrote:

Hi,

I'm not sure is there any rfc for this and which is it, but I see that
using vnd.oma.pres-content+xml content type is when you want to put
your avatar on xcap server. ( http://openxcap.org/wiki/Icon ).
You mean that account avatar is retrieved differently than the contact
avatars? You see some problem in this or its not working?

Currently I can see when starting Jitsi that my avatar is retrieved
with http request :
GET /xcap-root/oma_status-icon/users/sip:myUser@my_server/sip_communicator

Thanks
damencho


#5

Hi,

Our own avatar is get with the url I already mentioned (GET
/xcap-root/oma_status-icon/users/sip:myUser@my_server/sip_communicator)
and the content that server returns is a PNG, only the server reports
it as content-type:application/vnd.oma.pres-content+xml, but that's
not our problem.

I just made the following discovery:

When my XCAP server sends our own avatar image as PNG with

Content-Type: application/vnd.oma.pres-content+xml; charset=utf-8

it all works fine. However when it sends it as:

Content-Type: image/png

it doesn't work (no avatar is displayed in the GUI).

That is why I had impression earlier on it doesn't work at all.

Can't find any RFC though to find out which "Content-Type:" for GET
request is correct.

Will try to dig a bit more and post any findings.

Regards,
Chris

···

On 8 August 2011 09:34, Damian Minkov <damencho@jitsi.org> wrote:


#6

hmmm, actually although our own avatar is set in the GUI I am getting
the following error in the console:

[java] [Fatal Error] :1:1: Content is not allowed in prolog.

which I think is because as I said earlier this code:

impl/protocol/sip/OperationSetServerStoredAccountInfoSipImpl.java line 458:

ContentType presContent = xCapClient.getPresContent(
                   ProtocolProviderServiceSipImpl.PRES_CONTENT_IMAGE_NAME);

expected XML document and not raw PNG data (although it somehow
manages to read it).

Could someone correct me if I am wrong in thinking the above code is
responsible for fetching our own avatar?

Because if it is, than I think it should be changed to:

avatarImage = xCapClient.getImage(imageUri);

Cheers,
Chris