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

Include image dimensions in the image URL for server side image resizing



    • Improvement
    • Resolution: Fixed
    • Major
    • 2.5 M2
    • 2.5 M1
    • {Unused} Rendering 2.0
    • None
    • Unit
    • Easy


      Currently the image plugin [1] allows us to create image thumbnails by specifying the image width and/or height in the query string of the image attachment download URL:


      I propose that we:

      (A) Use the image width and/or height (when they are specified in the image syntax using pixel unit) to resize the image on the server side. For instance:


      will be linked to



      [[image:logo.jpg||style="height: 50px; width: 70px"]]

      will be linked to


      The image plugin also accepts a quality parameter that controls the compression quality when encoding jpeg images. The default value of this parameter (i.e. when not specified in the URL) is configurable. I propose we use 0.3 by default, 1 representing the best quality.

      (B) Add the ability to limit the image dimensions (preserving aspect ratio) when the image width and/or height are not specified in the image syntax (or when they are not using pixel unit). The width and height limit will be configurable and -1 by default (i.e. no limitation). For instance:


      will be linked to


      when width limit is 1024, and to


      when width limit is 1024 and height limit is 768. Note that in this case the image aspect ratio is preserved. The image is resized to best fit the limits. If the user want to bypass the limit he has to specify the image width/height in the image syntax.


        Issue Links



              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              0 Vote for this issue
              0 Start watching this issue