Details
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/>")