From 90de1ece9b6504bde08362472178ace50c613878 Mon Sep 17 00:00:00 2001 From: scyclops Date: Tue, 14 May 2024 21:28:05 -0500 Subject: [PATCH] Fix border color trimming for Pillow 10+ Pillow 10+ added an alpha_only keyword parameter to getbbox that defaults to True. For the border trimmer to work correctly, alpha_only must be set to False. https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html --- pilkit/processors/crop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pilkit/processors/crop.py b/pilkit/processors/crop.py index b039d30..e8eccc1 100644 --- a/pilkit/processors/crop.py +++ b/pilkit/processors/crop.py @@ -66,7 +66,7 @@ def process(self, img): .convert('RGBA') diff = ImageChops.subtract(diff, tmp) - bbox = diff.getbbox() + bbox = diff.getbbox(alpha_only=False) if bbox: img = _crop(img, bbox, self.sides) return img