Skip to content

Commit

Permalink
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'
Browse files Browse the repository at this point in the history
Fixed Error
  • Loading branch information
Vidalnt committed Aug 21, 2024
1 parent 7915b6b commit 082a8c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imjoy_elfinder/elfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ def __resize(self) -> None:
try:
img = self._img.open(cur_file) # type: ignore
img_resized = img.resize(
(width, height), self._img.ANTIALIAS # type: ignore
(width, height), self._img.Resampling.LANCZOS # type: ignore
)
img_resized.save(cur_file)
self._rm_tmb(cur_file)
Expand Down Expand Up @@ -1796,7 +1796,7 @@ def _tmb(self, path: str, tmb_path: str) -> bool:
box = _crop_tuple(img.size)
if box:
img = img.crop(box)
img.thumbnail(size, self._img.ANTIALIAS) # type: ignore
img.thumbnail(size, self._img.Resampling.LANCZOS) # type: ignore
img.save(tmb_path, "PNG")
# UnidentifiedImageError requires Pillow 7.0.0
except (OSError, ValueError) as exc:
Expand Down

0 comments on commit 082a8c2

Please sign in to comment.