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

XWiki.LiveTableResultsMacros _images column includes unscaled thumbnails with <img> having width set to 50

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.0
    • 3.5
    • LiveTable
    • None
    • livetable _images thumbnails not scaled
    • Trivial

    Description

      In the XWiki.LiveTableResultsMacros code the width for the image is set to 50px,
      however the source image url does not include the ?width=50 parameter to the scale the image attachment, which wastes bandwidth with large attachments.

      #**
       * List image attachments for a document, putting the result as HTML markup in the $imagesList variable.
       *#
      #macro(livetable_getImagesList $itemDoc)
        #set($imagesList = '')
        #foreach ($attachment in $itemDoc.attachmentList)
          #if($attachment.isImage())
            #set($attachmentUrl = $itemDoc.getAttachmentURL($attachment.filename))
            #set($imagesList = "${imagesList}<img src='${attachmentUrl}' alt='${attachment.filename}' width='50'/><br/>")
          #end
        #end
      #end
      

      Could this be updated to scale the images server side?

      #set($imagesList = "${imagesList}<img src='${attachmentUrl}?width=50' alt='${attachment.filename}' width='50'/><br/>")
      

      Attachments

        Activity

          People

            mflorea Marius Dumitru Florea
            jamiem Jamie Maher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: