Module documentation
Usage
{{#invoke:ImageRatio|ratio|Filename.jpg}}
This returns the ratio of width to height (w/h) for an image. Defaults to returning 1 if the image doesn't exist, this avoids divide by 0 errors in templates that use it.
local p={}function p.ratio(frame)local file = frame.args[1] and mw.title.new('File:' .. mw.uri.decode(mw.ustring.gsub(frame.args[1],'%|.*$',''), 'WIKI'))file = file and file.filelocal w = tonumber(file.width) or 1local h = tonumber(file.height) or 1 local r = w/h or 1return rendreturn p
🔥 Top keywords: Main PageSpecial:SearchIndian Premier LeagueWikipedia:Featured picturesPornhubUEFA Champions League2024 Indian Premier LeagueFallout (American TV series)Jontay PorterXXXTentacionAmar Singh ChamkilaFallout (series)Cloud seedingReal Madrid CFCleopatraRama NavamiRichard GaddDeaths in 2024Civil War (film)Shōgun (2024 miniseries)2024 Indian general electionJennifer PanO. J. SimpsonElla PurnellBaby ReindeerCaitlin ClarkLaverne CoxXXX (film series)Facebook2023–24 UEFA Champions LeagueYouTubeCandidates Tournament 2024InstagramList of European Cup and UEFA Champions League finalsJude BellinghamMichael Porter Jr.Andriy LuninCarlo AncelottiBade Miyan Chote Miyan (2024 film)