mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +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,
|
||||
JID, ItemID, [Payload]) of
|
||||
{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,
|
||||
width = W,
|
||||
height = H,
|
||||
type = MimeType,
|
||||
bytes = size(Data)},
|
||||
Meta1 = Meta#avatar_meta{info = [I|Info]},
|
||||
|
Loading…
Reference in New Issue
Block a user