diff --git a/frontools/screenshot.py b/frontools/screenshot.py index 439fb9a..161fd3e 100644 --- a/frontools/screenshot.py +++ b/frontools/screenshot.py @@ -67,14 +67,17 @@ async def _diff_url(left: Browser, right: Browser, url: str, output_path: Path) with NamedTemporaryFile(mode="wb") as left_file: left_file.write(left_bytes) - left_image = Image.open(left_file.name) + left_image = Image.open(left_file.name).convert('RGB') with NamedTemporaryFile(mode="wb") as right_file: right_file.write(right_bytes) - right_image = Image.open(right_file.name) + right_image = Image.open(right_file.name).convert('RGB') diff = ImageChops.difference(left_image, right_image) + if not diff.getbbox(): + return + url_slug = get_url_slug(url) if not output_path.is_dir(): output_path.mkdir()