Omnibus commited on
Commit
8a85d52
1 Parent(s): e38561e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -17,11 +17,12 @@ driver_type = 'chromedriver'
17
  driver=False
18
 
19
 
20
- def html2im():
21
 
22
- html = """<h1> An interesting title </h1> This page will be red"""
23
- css = "body {background: red;}"
24
- hti.screenshot(html_str=html, css_str=css, save_as='red_page.png')
 
25
  return 'red_page.png'
26
 
27
  def get_concat_h_cut(in1, in2):
@@ -127,6 +128,6 @@ with gr.Blocks() as app:
127
  out=gr.Image()
128
  outgal=gr.Gallery()
129
  outim = gr.Image()
130
- btn.click(html2im,None,out)
131
  #btn.click(run_script,[inp,height,width,check_b,check_h],[outim,message,outgal,out])
132
  app.queue(default_concurrency_limit=5).launch()
 
17
  driver=False
18
 
19
 
20
+ def html2im(html,css=None):
21
 
22
+ html = html
23
+ #css = css
24
+ hti.screenshot(html_str=html, save_as='red_page.png')
25
+ #hti.screenshot(html_str=html, css_str=css, save_as='red_page.png')
26
  return 'red_page.png'
27
 
28
  def get_concat_h_cut(in1, in2):
 
128
  out=gr.Image()
129
  outgal=gr.Gallery()
130
  outim = gr.Image()
131
+ btn.click(html2im,inp,out)
132
  #btn.click(run_script,[inp,height,width,check_b,check_h],[outim,message,outgal,out])
133
  app.queue(default_concurrency_limit=5).launch()