Skip to content

Commit fce9aad

Browse files
committed
settings: Replace PIL.Image.ANTIALIAS with PIL.Image.LANCZOS.
LANCZOS is already available in current pillow versions, so there are no compatibility issues. Fixes #11746.
1 parent 86bfdbf commit fce9aad

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

files/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ def _on_face_browse_menuitem_activated(self, menuitem):
683683
if response == Gtk.ResponseType.OK:
684684
path = dialog.get_filename()
685685
image = PIL.Image.open(path)
686-
image.thumbnail((96, 96), Image.ANTIALIAS)
686+
image.thumbnail((96, 96), Image.LANCZOS)
687687
face_path = os.path.join(user.get_home_dir(), ".face")
688688
try:
689689
try:

files/usr/share/cinnamon/cinnamon-settings/bin/imtools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def create_corner(radius=100, opacity=255, factor=2):
228228
draw = ImageDraw.Draw(corner)
229229
draw.pieslice((0, 0, 2 * factor * radius, 2 * factor * radius),
230230
180, 270, fill=opacity)
231-
corner = corner.resize((radius, radius), Image.ANTIALIAS)
231+
corner = corner.resize((radius, radius), Image.LANCZOS)
232232
return corner
233233

234234
def get_format(ext):

files/usr/share/cinnamon/cinnamon-settings/modules/cs_backgrounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def get_pix(self, filename, size=None):
628628
img = Image.alpha_composite(bg_img, img)
629629
img = img.convert("RGB")
630630
if size:
631-
img.thumbnail((size, size), Image.ANTIALIAS)
631+
img.thumbnail((size, size), Image.LANCZOS)
632632

633633
import imtools
634634
img = imtools.round_image(img, {}, False, None, 3, 255)

files/usr/share/cinnamon/cinnamon-settings/modules/cs_user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def _on_face_photo_menuitem_activated(self, menuitem):
165165
bottom = (height + new_height) / 2
166166

167167
image = image.crop((left, top, right, bottom))
168-
image.thumbnail((255, 255), Image.ANTIALIAS)
168+
image.thumbnail((255, 255), Image.LANCZOS)
169169

170170
face_path = os.path.join(self.accountService.get_home_dir(), ".face")
171171

@@ -202,7 +202,7 @@ def _on_face_browse_menuitem_activated(self, menuitem):
202202
if response == Gtk.ResponseType.OK:
203203
path = dialog.get_filename()
204204
image = Image.open(path)
205-
image.thumbnail((255, 255), Image.ANTIALIAS)
205+
image.thumbnail((255, 255), Image.LANCZOS)
206206
face_path = os.path.join(self.accountService.get_home_dir(), ".face")
207207
image.save(face_path, "png")
208208
self.accountService.set_icon_file(face_path)

0 commit comments

Comments
 (0)