mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Add 'width' and 'height' to avatar info
This commit is contained in:
parent
f435d0a103
commit
5bf64381cb
@ -267,7 +267,16 @@ publish_avatar(#iq{from = JID} = IQ, Meta, MimeType, Data, ItemID) ->
|
|||||||
LBJID, LServer, ?NS_AVATAR_DATA,
|
LBJID, LServer, ?NS_AVATAR_DATA,
|
||||||
JID, ItemID, [Payload]) of
|
JID, ItemID, [Payload]) of
|
||||||
{result, _} ->
|
{result, _} ->
|
||||||
|
{W, H} = case eimp:identify(Data) of
|
||||||
|
{ok, ImgInfo} ->
|
||||||
|
{proplists:get_value(width, ImgInfo),
|
||||||
|
proplists:get_value(height, ImgInfo)};
|
||||||
|
_ ->
|
||||||
|
{undefined, undefined}
|
||||||
|
end,
|
||||||
I = #avatar_info{id = ItemID,
|
I = #avatar_info{id = ItemID,
|
||||||
|
width = W,
|
||||||
|
height = H,
|
||||||
type = MimeType,
|
type = MimeType,
|
||||||
bytes = size(Data)},
|
bytes = size(Data)},
|
||||||
Meta1 = Meta#avatar_meta{info = [I|Info]},
|
Meta1 = Meta#avatar_meta{info = [I|Info]},
|
||||||
|
Loading…
Reference in New Issue
Block a user