Module:Image size

local prelookups = { ["Map point BLK.svg"] = "15,15", ["Map point BLU.svg"] = "15,15", ["Map point BRW.svg"] = "15,15", ["Map point CYN.svg"] = "15,15", ["Map point DGN.svg"] = "15,15", ["Map point DGR.svg"] = "15,15", ["Map point GRN.svg"] = "15,15", ["Map point GRY.svg"] = "15,15", ["Map point LGR.svg"] = "15,15", ["Map point MGN.svg"] = "15,15", ["Map point ORG.svg"] = "15,15", ["Map point PNK.svg"] = "15,15", ["Map point PRP.svg"] = "15,15", ["Map point RED.svg"] = "15,15", ["Map point WHT.svg"] = "15,15", ["Map point YLW.svg"] = "15,15", }

local image_size = {}

function image_size.getSize(frame) imgName = frame.args[1] plu = prelookups[imgName] if plu then return plu end img = mw.title.makeTitle("Image",imgName) if img == nil then return "0,0" end imgFile = img.file if imgFile.exists then return imgFile.width..","..imgFile.height else return "0,0" end end

return image_size