Use newer Pillow resampling filter constants.#27
Open
lvonlanthen wants to merge 1 commit intoopenzoom:masterfrom
Open
Use newer Pillow resampling filter constants.#27lvonlanthen wants to merge 1 commit intoopenzoom:masterfrom
lvonlanthen wants to merge 1 commit intoopenzoom:masterfrom
Conversation
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.
|
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. |
|
I can confirm that this fix works with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Pillow 10.0.0,
PIL.Image.CUBICandPIL.Image.ANTIALIASwere removed. Instead,PIL.Image.BICUBICandPIL.Image.LANCZOSrespectively should be used.