Skip to content

Commit 8c12f49

Browse files
bot callout
1 parent f1d2a7f commit 8c12f49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sentry/preprod/snapshots/image_diff/compare.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def _to_pil_image(source: bytes | Image.Image) -> Image.Image:
2626

2727

2828
def _mask_from_diff_output(output_path: Path) -> Image.Image:
29-
alpha = Image.open(output_path).convert("RGBA").split()[3]
29+
with Image.open(output_path) as img:
30+
alpha = img.convert("RGBA").split()[3]
3031
return alpha.point(lambda px: 255 if px > 0 else 0)
3132

3233

0 commit comments

Comments
 (0)