View source for Module:Wide image
From HandWiki
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
-- This module implements [[template:wide image]] and [[template:panorama]]
local p = {}
local function getfilename(s)
s = mw.ustring.gsub(s or '', '^%s*[Ff][Ii][Ll][Ee]%s*:%s*', '')
s = mw.ustring.gsub(s or '', '^%s*[Ii][Mm][Aa][Gg][Ee]%s*:%s*', '')
return s
end
local function getwidth(s, w, h)
w = mw.ustring.gsub(w or '0', '^%s*(%d+)%s*[Pp][Xx]*%s*$', '%1')
h = mw.ustring.gsub(h or '0', '^%s*(%d+)%s*[Pp][Xx]*%s*$', '%1')
w = tonumber(w) or 0
h = tonumber(h) or 0
if w > 0 then
return w
end
local file = s and mw.title.new('File:' .. mw.uri.decode(mw.ustring.gsub(s,'%|.*$',''), 'WIKI'))
file = file and file.file or {width = 0, height = 0}
000
1:0
Template used on this page:
Return to Module:Wide image.