Soham0708 commited on
Commit
8d8b621
·
verified ·
1 Parent(s): 54bc267

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -15,7 +15,22 @@ class HtmlInput(BaseModel):
15
 
16
 
17
  async def convert_html_to_image(html, output_file, width=612, height=800, device_scale_factor=2):
18
- browser = await launch(headless=True, args=['--no-sandbox', '--disable-setuid-sandbox'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  page = await browser.newPage()
20
  await page.setViewport({'width': width, 'height': height, 'deviceScaleFactor': device_scale_factor})
21
  await page.setContent(html)
 
15
 
16
 
17
  async def convert_html_to_image(html, output_file, width=612, height=800, device_scale_factor=2):
18
+ browser = await launch(
19
+ headless=True,
20
+ args=[
21
+ '--no-sandbox',
22
+ '--disable-setuid-sandbox',
23
+ '--disable-gpu',
24
+ '--disable-dev-shm-usage', # Try to disable /dev/shm usage
25
+ '--disable-software-rasterizer',
26
+ '--disable-accelerated-2d-canvas',
27
+ '--disable-infobars',
28
+ '--disable-extensions',
29
+ '--disable-features=NetworkService',
30
+ '--disable-features=VizDisplayCompositor',
31
+ '--window-size=612,800'
32
+ ]
33
+ )
34
  page = await browser.newPage()
35
  await page.setViewport({'width': width, 'height': height, 'deviceScaleFactor': device_scale_factor})
36
  await page.setContent(html)