We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1d2a7f commit 8c12f49Copy full SHA for 8c12f49
src/sentry/preprod/snapshots/image_diff/compare.py
@@ -26,7 +26,8 @@ def _to_pil_image(source: bytes | Image.Image) -> Image.Image:
26
27
28
def _mask_from_diff_output(output_path: Path) -> Image.Image:
29
- alpha = Image.open(output_path).convert("RGBA").split()[3]
+ with Image.open(output_path) as img:
30
+ alpha = img.convert("RGBA").split()[3]
31
return alpha.point(lambda px: 255 if px > 0 else 0)
32
33
0 commit comments