Module:Sandbox/Frietjes

This is an old revision of this page, as edited by Frietjes (talk | contribs) at 22:50, 2 February 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

function p.data(frame)
	local args = frame.args[1] and frame.args or frame:getParent().args
	local file = args[1] and mw.title.new(args[1]).file or {width = '?', height = '?'}
	if args[2] == 'width' then
		return file.width
	elseif args[2] == 'height' then
		return file.height
	elseif args[2] == 'size' then
		return file.size
	end
	return '???' .. args[2] .. '???'
end

return p