Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-5914

Control avatar size when uploaded

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.6.1
    • Fix Version/s: None
    • Component/s: Model
    • Labels:
    • Difficulty:
      Medium
    • Pull Request Status:
      Awaiting Pull Request creation
    • Similar issues:

      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

            Activity

              People

              Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              goulven Goulven Furet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: