Module:Compositor

local p = { } function p.composite(frame) local argument_numbers = 0 for _ in ipairs(frame.args) do		argument_numbers = argument_numbers + 1 end local original_image = frame.args[1] local original_size_x = tonumber(frame.args[2]) local original_size_y = tonumber(frame.args[3]) local new_size_x = tonumber(frame.args[4]) local new_size_y = tonumber(frame.args[5]) local x_ratio = new_size_x / original_size_x local y_ratio = new_size_y / original_size_y local temp = "\n" local elements = { } local elem_number = math.ceil((argument_numbers - 5) / 5) for i=1,elem_number do		elements[i] = { } elements[i].elem = frame.args[6+((i-1)*5)] elements[i].x = tonumber(frame.args[7+((i-1)*5)]) elements[i].y = tonumber(frame.args[8+((i-1)*5)]) elements[i].offset_x = math.ceil(tonumber(frame.args[9+((i-1)*5)]) / 2) elements[i].offset_y = math.ceil(tonumber(frame.args[10+((i-1)*5)]) / 2) end for key,value in ipairs(elements) do temp = temp .."" .. value.elem .. " \n" end temp = temp .. " "	return temp end return p