Details
Description
Hi guys,
We needed to have a check on the size of avatars uploaded by users. It was as a TODO in the changeavatar.vm
so I follow you my implementation.
Modified classes are based on 2.6 of xwiki-core.jar :
com.xpn.xwiki.doc.XWikiAttachment
com.xpn.xwiki.api.Attachment
Modified template is based on 2.6 too :
changeavatar.vm
A basic ImageInfo object (inner class in XWikiAttachment, get images properties with javax.imageio)
is singletoned in XWikiAttachement. It is made availlable from templates via api.Atttachment
Note that in changeavatar.vm, error messages and max dimensions are hardcoded and tha the redirection if picture too big is done upon javascript
Attachments
Issue Links
- duplicates
-
XWIKI-6856 Support thumbnail editing on user profile avatar picture
- Open
- relates to
-
XWIKI-10603 Optimize uploaded profile pictures by limiting dimensions
- Open