import asyncio, sys
from playwright.async_api import async_playwright
D='/workspace/logo-ga-18nov/wordmark'
async def main():
    async with async_playwright() as p:
        b=await p.chromium.launch(executable_path='/usr/bin/google-chrome',args=['--no-sandbox'])
        pg=await b.new_page(viewport={'width':2400,'height':1700})
        files=sys.argv[1:]
        html='<body style="margin:0;background:#ccc">'+''.join(f'<div style="background:#fff;margin:6px"><img src="file://{D}/svg/{f}" style="width:2380px;display:block"></div>' for f in files)+'</body>'
        open('/tmp/val.html','w').write(html)
        await pg.goto('file:///tmp/val.html'); await pg.wait_for_timeout(500)
        await pg.screenshot(path=f'{D}/work/val.png',full_page=True)
        await b.close()
asyncio.run(main())
