Skip to content

Commit 5a59160

Browse files
author
Hugo Osvaldo Barrera
committed
Update some references from PIL to Pillow
Fixes #12
1 parent 35eed3d commit 5a59160

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Requirements
2929
- Setuptools/distribute for installation.
3030
- Python 3.5 or above
3131
- Program to open SVG objects (your browser should do it)
32-
- Optional: PIL to render barcodes as images (PNG, JPG, ...)
32+
- Optional: Pillow to render barcodes as images (PNG, JPG, ...)
3333

3434

3535
Installation
@@ -92,7 +92,7 @@ Interactive::
9292
>>> ean.write(fp)
9393
# or
9494
>>> f = open('/my/new/file', 'wb')
95-
>>> ean.write(f) # PIL (ImageWriter) produces RAW format here
95+
>>> ean.write(f) # Pillow (ImageWriter) produces RAW format here
9696
# New in v0.5.0
9797
>>> from barcode import generate
9898
>>> name = generate('EAN13', '5901234123457', output='barcode_svg')
@@ -122,6 +122,7 @@ v0.9.1
122122
~~~~~~
123123

124124
* Officially support Python 3.7
125+
* Refer to Pillow in the docs, rather than PIL.
125126

126127
v0.9.0
127128
~~~~~~

barcode/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
88
This package provides a simple way to create standard barcodes.
99
It needs no external packages to be installed, the barcodes are
10-
created as SVG objects. If PIL (Python Imaging Library) is
11-
installed, the barcodes can also be rendered as images (all
12-
formats supported by PIL).
10+
created as SVG objects. If Pillow is installed, the barcodes can also be
11+
rendered as images (all formats supported by Pillow).
1312
"""
1413

1514
from barcode.errors import BarcodeNotFoundError

barcode/pybarcode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def list_types(args, parser=None):
3333
print('Available image formats')
3434
print('Standard: svg')
3535
if ImageWriter is not None:
36-
print('PIL:', ', '.join(IMG_FORMATS))
36+
print('Pillow:', ', '.join(IMG_FORMATS))
3737
else:
38-
print('PIL: disabled')
38+
print('Pillow: disabled')
3939
print('\n')
4040

4141

@@ -68,7 +68,7 @@ def main():
6868
msg = []
6969
if ImageWriter is None:
7070
msg.append(
71-
'Image output disabled (PIL not found), --type option disabled.'
71+
'Image output disabled (Pillow not found), --type option disabled.'
7272
)
7373
else:
7474
msg.append(

barcode/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
except ImportError:
1919
import logging
2020
log = logging.getLogger('pyBarcode')
21-
log.info('PIL not found. Image output disabled')
21+
log.info('Pillow not found. Image output disabled')
2222
Image = ImageDraw = ImageFont = None # lint:ok
2323

2424

docs/barcode.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Introduction
22
============
33

4-
This package was created to have barcodes available without having
5-
PIL_ (Python Imaging Library) installed. As of version 0.4b1 PIL
6-
is also supported for creating barcodes.
4+
This package was created to have barcodes available with pure-python.
5+
Pillow_ is required for exporting for exporting images (png, jpg), although not
6+
for SVGs.
77

88
All you need to create a barcode is to know the system (EAN, UPC, ...)
99
and the code (e.g. for EAN-13: 123456789102). As you see, you do not
@@ -13,7 +13,7 @@ keyword argument (default is True).
1313

1414
As of version 0.7beta3 Python 3 is supported, but not well tested.
1515

16-
.. _PIL: http://www.pythonware.com/products/pil
16+
.. _Pillow: https://python-pillow.org/
1717

1818
Creating barcodes as SVG
1919
------------------------

docs/writers/image.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pyBarcode ImageWriter
33

44
.. versionadded:: 0.4b1
55

6-
Creates barcodes as image. All imagetypes supported by PIL are availble.
6+
Creates barcodes as image. All imagetypes supported by Pillow are availble.
77

88
Special Options
99
---------------
@@ -15,7 +15,7 @@ Special Options:
1515
~~~~~~~~~~~~~~~~
1616

1717
:format:
18-
The image file format as *string*. All formats supported by PIL are
18+
The image file format as *string*. All formats supported by Pillow are
1919
valid (e.g. PNG, JPEG, BMP, ...).
2020
Defaults to **PNG**.
2121

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
author='Thorsten Weimann et al',
1313
author_email='[email protected]',
1414
description=(
15-
'Create standard barcodes with Python. No external modules needed '
16-
'(optional PIL support included).'
15+
'Create standard barcodes with Python. No external modules needed. '
16+
'(optional Pillow support included).'
1717
),
1818
long_description=Path('README.rst').read_text(),
1919
classifiers=[

test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
IMAGES = ('<h3>As PNG-Image</h3><br>\n'
4646
'<img src="{filename}" alt="PNG {name}"></p>\n')
4747

48-
NO_PIL = '<h3>PIL was not found. No PNG-Image created.</h3></p>\n'
48+
NO_PIL = '<h3>Pillow was not found. No PNG-Image created.</h3></p>\n'
4949

5050
TESTCODES = (
5151
('ean8', '40267708'),

0 commit comments

Comments
 (0)