Skip to content

Commit

Permalink
Call this hti as per example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 6, 2023
1 parent 487c099 commit 0bdcbfb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions funnel/views/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ def render_project_preview_image(project_id: int) -> None:
fd, temp_filepath = tempfile.mkstemp('.png')
os.close(fd)
temp_dir, temp_filename = os.path.split(temp_filepath)
renderer = Html2Image(size=(640, 360), output_path=temp_dir)
hti = Html2Image(size=(640, 360), output_path=temp_dir)
html_src = render_template('preview/project.html.jinja2', project=project)
screenshot_files = renderer.screenshot(
html_str=html_src, save_as=temp_filename, size=(640, 360)
)
screenshot_files = hti.screenshot(html_str=html_src, save_as=temp_filename)

if screenshot_files:
with open(screenshot_files[0], mode='rb') as file:
Expand Down

0 comments on commit 0bdcbfb

Please sign in to comment.