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

Replace ANTIALIAS with LANCZOS #146

Closed
wants to merge 1 commit into from
Closed

Conversation

Salieri24
Copy link

Hello, I was using your python package and I noticed that on my new configuration, it has started returning errors:

deprecation warning: brother_ql.devicedependent is deprecated and will be removed in a future release
Traceback (most recent call last):
  File ".../brother_ql", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/brother_ql/cli.py", line 146, in print_cmd
    instructions = convert(qlr=qlr, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/brother_ql/conversion.py", line 112, in convert
    im = im.resize((dots_printable[0], hsize), Image.ANTIALIAS)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

After investigating, I found the following:

ANTIALIAS was removed in Pillow 10.0.0 (after being deprecated through many previous versions). Now you need to use PIL.Image.LANCZOS or PIL.Image.Resampling.LANCZOS.

Source

I temporarily reverted to version 9.5 of Pillow, but I thought that it would be nice to create a pull request as well.

Best regards,
Angel

@FriedrichFroebel
Copy link

Duplicate of #143.

@Salieri24 Salieri24 closed this Dec 8, 2023
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.

None yet

2 participants