Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use newer Pillow resampling filter constants. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lvonlanthen
Copy link

With Pillow 10.0.0, PIL.Image.CUBIC and PIL.Image.ANTIALIAS were removed. Instead, PIL.Image.BICUBIC and PIL.Image.LANCZOS respectively should be used.

With Pillow 10.0.0, `PIL.Image.CUBIC` and `PIL.Image.ANTIALIAS` were removed. Instead, `PIL.Image.BICUBIC` and `PIL.Image.LANCZOS` respectively should be used.
@hlovdal
Copy link

hlovdal commented Jun 25, 2024

Without this fix, program fails like

$ python ./helloworld-dzi.py
Traceback (most recent call last):
  File "C:\github\deepzoom.py\examples\helloworld\helloworld-dzi.py", line 5, in <module>
    import deepzoom
  File "C:\github\deepzoom.py\venv\lib\site-packages\deepzoomtools-2.0.0-py3.10.egg\deepzoom\__init__.py", line 57, in <module>
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

With it it still failed

$ python ./helloworld-dzi.py
Traceback (most recent call last):
  File "C:\Python310\lib\urllib\request.py", line 1505, in open_local_file
    stats = os.stat(localfile)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\github\deepzoom.py\examples\helloworld\helloworld-dzi.py", line 20, in <module>
    creator.create(SOURCE, "output/helloworld.dzi")
  File "C:\github\deepzoom.py\venv\lib\site-packages\deepzoomtools-2.0.0-py3.10.egg\deepzoom\__init__.py", line 422, in create
  File "C:\github\deepzoom.py\venv\lib\site-packages\deepzoomtools-2.0.0-py3.10.egg\deepzoom\__init__.py", line 508, in f_retry
  File "C:\github\deepzoom.py\venv\lib\site-packages\deepzoomtools-2.0.0-py3.10.egg\deepzoom\__init__.py", line 504, in f_retry
  File "C:\github\deepzoom.py\venv\lib\site-packages\deepzoomtools-2.0.0-py3.10.egg\deepzoom\__init__.py", line 547, in safe_open
  File "C:\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python310\lib\urllib\request.py", line 519, in open
    response = self._open(req, data)
  File "C:\Python310\lib\urllib\request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Python310\lib\urllib\request.py", line 1483, in file_open
    return self.open_local_file(req)
  File "C:\Python310\lib\urllib\request.py", line 1522, in open_local_file
    raise URLError(exp)
urllib.error.URLError: <urlopen error [WinError 3] The system cannot find the path specified: ''>

but at least it is a step in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants