Module:ImageRatio

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>MusikBot II at 18:00, 21 October 2025 (Protected "Module:ImageRatio": High-risk template or module: 250 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.file
	local w = tonumber(file.width) or 1
	local h = tonumber(file.height) or 1
    local r = w/h or 1
	return r
end
return p