Skip to content

Commit

Permalink
fix ANTIALIAS (matmair#37)
Browse files Browse the repository at this point in the history
* fix: replaced removed Image.ANTIALIAS call with new PIL way

* feat: bumped pillow version to min 10.0.0

---------

Co-authored-by: Lennart Haas <[email protected]>
  • Loading branch information
matmair and Th00z authored Dec 17, 2023
1 parent dcc452c commit 5ca6914
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion brother_ql/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def convert(qlr, images, label, **kwargs):
im = im.resize((im.size[0]//2, im.size[1]))
if im.size[0] != dots_printable[0]:
hsize = int((dots_printable[0] / im.size[0]) * im.size[1])
im = im.resize((dots_printable[0], hsize), Image.ANTIALIAS)
im = im.resize((dots_printable[0], hsize), Image.LANCZOS)
logger.warning('Need to resize the image...')
if im.size[0] < device_pixel_width:
new_im = Image.new(im.mode, (device_pixel_width, im.size[1]), (255,)*len(im.mode))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies = [
"click",
"future",
"packbits",
"pillow>=3.3.0",
"pillow>=10.0.0",
"pyusb",
"attrs",
"typing;python_version<'3.5'",
Expand Down
67 changes: 67 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# -*- coding: utf-8 -*-

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

try:
import pypandoc
LDESC = open('README.md', 'r').read()
LDESC = pypandoc.convert(LDESC, 'rst', format='md')
except (ImportError, IOError, RuntimeError) as e:
print("Could not create long description:")
print(str(e))
LDESC = ''

setup(name='brother_ql',
version = '0.9.dev0',
description = 'Python package to talk to Brother QL label printers',
long_description = LDESC,
author = 'Philipp Klaus',
author_email = '[email protected]',
url = 'https://github.com/pklaus/brother_ql',
license = 'GPL',
packages = ['brother_ql',
'brother_ql.backends'],
entry_points = {
'console_scripts': [
'brother_ql = brother_ql.cli:cli',
'brother_ql_analyse = brother_ql.brother_ql_analyse:main',
'brother_ql_create = brother_ql.brother_ql_create:main',
'brother_ql_print = brother_ql.brother_ql_print:main',
'brother_ql_debug = brother_ql.brother_ql_debug:main',
'brother_ql_info = brother_ql.brother_ql_info:main',
],
},
include_package_data = False,
zip_safe = True,
platforms = 'any',
install_requires = [
"click",
"future",
"packbits",
"pillow>=10.0.0",
"pyusb",
'attrs',
'typing;python_version<"3.5"',
'enum34;python_version<"3.4"',
],
extras_require = {
#'brother_ql_analyse': ["matplotlib",],
#'brother_ql_create' : ["matplotlib",],
},
keywords = 'Brother QL-500 QL-550 QL-560 QL-570 QL-700 QL-710W QL-720NW QL-800 QL-810W QL-820NWB QL-1050 QL-1060N',
classifiers = [
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Visualization',
'Topic :: System :: Hardware :: Hardware Drivers',
]
)



0 comments on commit 5ca6914

Please sign in to comment.