মডিউল:Main page image: সংশোধিত সংস্করণের মধ্যে পার্থক্য
অবয়ব
অ Protected "Module:Main page image": High-risk Lua module: per this request ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite)) |
new image size calculation |
||
৮ নং লাইন: | ৮ নং লাইন: | ||
function p._width(args) | function p._width(args) | ||
local new_width = 140 | local new_width = 140 | ||
local page = mw.title.makeTitle('File', args[1]) | local page = mw.title.makeTitle('File', args[1]) | ||
if not page.fileExists then | if not page.fileExists then | ||
১৪ নং লাইন: | ১৪ নং লাইন: | ||
end | end | ||
new_width = math.floor ( ( page.file.width / math.sqrt ( ( page.file.width * page.file.height ) / 19600 ) ) + 0.5 ) | |||
return new_width | return new_width |
১২:৫১, ৮ সেপ্টেম্বর ২০২০ তারিখে সংশোধিত সংস্করণ
এই মডিউলের জন্য মডিউল:Main page image/নথি-এ নথিপত্র তৈরি করা হয়ে থাকতে পারে
local p = {}
local getArgs = require('Module:Arguments').getArgs
function p.width(frame)
local args = getArgs(frame)
return p._width(args)
end
function p._width(args)
local new_width = 140
local page = mw.title.makeTitle('File', args[1])
if not page.fileExists then
return new_width
end
new_width = math.floor ( ( page.file.width / math.sqrt ( ( page.file.width * page.file.height ) / 19600 ) ) + 0.5 )
return new_width
end
return p