Module:ImageRatio: Difference between revisions

Content deleted Content added
After Module:Multiple image. May be horrifically broken
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1:
local p={}
function p.ratio(imageframe)
local file = imageframe.args[1] and mw.title.new('File:' .. mw.uri.decode(mw.ustring.gsub(imageframe.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