From 0bdcbfb61a3d6886fd9e24663079a475da862177 Mon Sep 17 00:00:00 2001 From: Kiran Jonnalagadda Date: Mon, 6 Nov 2023 12:07:45 +0530 Subject: [PATCH] Call this `hti` as per example in docs --- funnel/views/thumbnails.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/funnel/views/thumbnails.py b/funnel/views/thumbnails.py index 9b08f1ff3..a2ea47b99 100644 --- a/funnel/views/thumbnails.py +++ b/funnel/views/thumbnails.py @@ -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: