Skip to content

Commit

Permalink
Fix for Pillow 10 removing deprecated ANTIALIAS constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
revarbat committed Jan 25, 2024
1 parent 548a8d5 commit 7a502c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions openscad_runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def run(self):
for imgfile in imgfiles:
img = Image.open(imgfile)
if self.antialias != 1.0:
img.thumbnail(self.imgsize, Image.ANTIALIAS)
img.thumbnail(self.imgsize, Image.Resampling.LANCZOS)
imgs.append(img)
imgs[0].save(
self.outfile,
Expand All @@ -295,15 +295,15 @@ def run(self):
if self.antialias != 1.0:
for imgfile in imgfiles:
img = Image.open(imgfile)
img.thumbnail(self.imgsize, Image.ANTIALIAS)
img.thumbnail(self.imgsize, Image.Resampling.LANCZOS)
os.unlink(imgfile)
img.save(imgfile)
APNG.from_files(imgfiles, delay=self.animate_duration).save(self.outfile)
for imgfile in imgfiles:
os.unlink(imgfile)
elif float(self.antialias) != 1.0:
im = Image.open(self.outfile)
im.thumbnail(self.imgsize, Image.ANTIALIAS)
im.thumbnail(self.imgsize, Image.Resampling.LANCZOS)
os.unlink(self.outfile)
im.save(self.outfile)
self.complete = True
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

VERSION = "1.1.0"
VERSION = "1.1.1"


with open('README.rst') as f:
Expand Down

0 comments on commit 7a502c6

Please sign in to comment.