From 83a5dd06889526fdf07d9fd935ae5f56f7a0e71e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=83=D0=BB=D1=8C=D0=B1=D0=B0?= <81091299+ulbwa@users.noreply.github.com> Date: Sun, 23 Jan 2022 14:21:42 +0500 Subject: [PATCH] 2022.23.01.14 --- MockupModule/__init__.py | 6 ++++-- setup.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MockupModule/__init__.py b/MockupModule/__init__.py index 2d83363..9f3fdd2 100644 --- a/MockupModule/__init__.py +++ b/MockupModule/__init__.py @@ -102,7 +102,7 @@ class MockupEngineer: screen_y = template.__landscape_y__ screen_mask = template.__landscape_mask__ if template.__use_mask__ else None - screenshot = self.resize(screenshot_path, screen_width, screen_height) + resized_screenshot_path = self.resize(screenshot_path, screen_width, screen_height) for template_color in template.colors: if template_color.color == color: @@ -117,7 +117,7 @@ class MockupEngineer: template_img = Image.open(template_path) mask_img = Image.new('RGBA', template_img.size, (0, 0, 0, 0)) - screenshot_img = Image.open(screenshot) + screenshot_img = Image.open(resized_screenshot_path) mask_img.paste(screenshot_img, (screen_x, screen_y)) mask_img.paste(template_img, (0, 0), template_img) @@ -126,4 +126,6 @@ class MockupEngineer: mask_img.putalpha(screen_mask) mask_img.save(mockup_path) + os.remove(resized_screenshot_path) + return mockup_path diff --git a/setup.py b/setup.py index 223e30f..04f4ca5 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup, find_packages setup( name='MockupEngineer', - version='2022.23.01.13', + version='2022.23.01.14', packages=find_packages(), url='https://github.com/ulbwazhine/MockupEngineer', license='MIT',