Jump to content

Module:ImageRatio: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
After Module:Multiple image. May be horrifically broken
(No difference)

Revision as of 09:37, 31 January 2024

function ratio(image)
	local file = image and mw.title.new('File:' .. mw.uri.decode(mw.ustring.gsub(image,'%|.*$',''), 'WIKI'))
	file = file and file.file
	w = tonumber(file.width) or 1
	h = tonumber(file.height) or 1
    r = w/h
	return r
end