Skip to content

Commit

Permalink
Replace Image.ANTIALIAS with Image.BICUBIC in QT and GTK (#700)
Browse files Browse the repository at this point in the history
Image.ANTIALIAS has been removed in PIL 10.0.0: https://pillow.readthedocs.io/en/stable/deprecations.html
Image.LANCZOS is identical but [it seems like overkill](#698 (comment)).
  • Loading branch information
molkoback authored Jul 11, 2023
1 parent 6d23c77 commit 901599f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion trackma/ui/gtk/imagebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _download_file(self):
def _save_image(self, img_bytes):
if imaging_available:
image = Image.open(img_bytes)
image.thumbnail((self._width, self._height), Image.ANTIALIAS)
image.thumbnail((self._width, self._height), Image.BICUBIC)
image.convert("RGB").save(self._filename)
else:
with open(self._filename, 'wb') as img_file:
Expand Down
2 changes: 1 addition & 1 deletion trackma/ui/qt/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run(self):
if self.size:
if "imaging_available" in os.environ:
im = Image.open(img_file)
im.thumbnail((self.size[0], self.size[1]), Image.ANTIALIAS)
im.thumbnail((self.size[0], self.size[1]), Image.BICUBIC)
im.convert("RGB").save(self.local)
else:
with open(self.local, 'wb') as f:
Expand Down

0 comments on commit 901599f

Please sign in to comment.