18
"Access", "Antialias", "Bands", "BitDecode", "Blend", "Chops",
19
"Convert", "ConvertYCbCr", "Copy", "Crc32", "Crop", "Dib", "Draw",
19
"Access", "AlphaComposite", "Antialias", "Bands", "BitDecode", "Blend",
20
"Chops", "Convert", "ConvertYCbCr", "Copy", "Crc32", "Crop", "Dib", "Draw",
20
21
"Effects", "EpsEncode", "File", "Fill", "Filter", "FliDecode",
21
22
"Geometry", "GetBBox", "GifDecode", "GifEncode", "HexDecode",
22
23
"Histo", "JpegDecode", "JpegEncode", "LzwDecode", "Matrix",
23
24
"ModeFilter", "MspDecode", "Negative", "Offset", "Pack",
24
"PackDecode", "Palette", "Paste", "Quant", "QuantHash",
25
"PackDecode", "Palette", "Paste", "Quant", "QuantOctree", "QuantHash",
25
26
"QuantHeap", "PcdDecode", "PcxDecode", "PcxEncode", "Point",
26
27
"RankFilter", "RawDecode", "RawEncode", "Storage", "SunRleDecode",
27
28
"TgaRleDecode", "Unpack", "UnpackYCC", "UnsharpMask", "XbmDecode",
28
"XbmEncode", "ZipDecode", "ZipEncode")
29
"XbmEncode", "ZipDecode", "ZipEncode", "TiffDecode")
31
32
def _add_directory(path, dir, where=None):
92
93
_add_directory(include_dirs, "libImaging")
98
for root in (TCL_ROOT, JPEG_ROOT, TIFF_ROOT, ZLIB_ROOT,
99
FREETYPE_ROOT, LCMS_ROOT):
100
if isinstance(root, type(())):
101
lib_root, include_root = root
103
lib_root = include_root = root
104
_add_directory(library_dirs, lib_root)
105
_add_directory(include_dirs, include_root)
95
108
# add platform directories
97
110
if sys.platform == "cygwin":
114
127
_add_directory(include_dirs, "/usr/X11/include")
116
129
elif sys.platform.startswith("linux"):
117
if platform.processor() == "x86_64":
118
_add_directory(library_dirs, "/lib64")
119
_add_directory(library_dirs, "/usr/lib64")
120
_add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
130
for platform_ in (platform.processor(),platform.architecture()[0]):
131
if not platform_: continue
133
if platform_ in ["x86_64", "64bit"]:
134
_add_directory(library_dirs, "/lib64")
135
_add_directory(library_dirs, "/usr/lib64")
136
_add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu")
138
elif platform_ in ["i386", "i686", "32bit"]:
139
_add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
122
_add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
142
raise ValueError("Unable to identify Linux platform: `%s`" % platform_)
124
144
# XXX Kludge. Above /\ we brute force support multiarch. Here we
125
145
# try Barry's more general approach. Afterward, something should
169
# add configured kits
171
for root in (TCL_ROOT, JPEG_ROOT, TCL_ROOT, TIFF_ROOT, ZLIB_ROOT,
172
FREETYPE_ROOT, LCMS_ROOT):
173
if isinstance(root, type(())):
174
lib_root, include_root = root
176
lib_root = include_root = root
177
_add_directory(library_dirs, lib_root)
178
_add_directory(include_dirs, include_root)
181
191
# add standard directories
278
296
libs.append(feature.zlib)
279
297
defs.append(("HAVE_LIBZ", None))
299
libs.append(feature.tiff)
300
defs.append(("HAVE_LIBTIFF", None))
280
301
if sys.platform == "win32":
281
302
libs.extend(["kernel32", "user32", "gdi32"])
282
303
if struct.unpack("h", "\0\1".encode('ascii'))[0] == 1:
353
379
def summary_report(self, feature, unsafe_zlib):
356
print("SETUP SUMMARY (Pillow %s / PIL %s)" % (VERSION, PIL_VERSION))
382
print("SETUP SUMMARY (Pillow %s fork, originally based on PIL %s)" % (VERSION, PIL_VERSION))
358
print("version %s" % VERSION)
384
print("version %s (Pillow)" % VERSION)
359
385
v = sys.version.split("[")
360
386
print("platform %s %s" % (sys.platform, v[0].strip()))
366
392
(feature.tcl and feature.tk, "TKINTER"),
367
393
(feature.jpeg, "JPEG"),
368
394
(feature.zlib, "ZLIB (PNG/ZIP)"),
369
# (feature.tiff, "experimental TIFF G3/G4 read"),
395
(feature.tiff, "TIFF G3/G4 (experimental)"),
370
396
(feature.freetype, "FREETYPE2"),
371
397
(feature.lcms, "LITTLECMS"),
398
(feature.webp, "WEBP"),
399
425
print("To add a missing option, make sure you have the required")
400
426
print("library, and set the corresponding ROOT variable in the")
401
427
print("setup.py script.")
404
430
print("To check the build, run the selftest.py script.")
406
433
def check_zlib_version(self, include_dirs):
407
434
# look for unsafe versions of zlib
448
475
description='Python Imaging Library (fork)',
449
476
long_description=(
450
_read('README.rst') +
451
_read('docs/INSTALL.txt') +
452
_read('docs/HISTORY.txt')).decode('utf-8'),
477
_read('README.rst') + b'\n' +
478
_read('docs/HISTORY.txt') + b'\n' +
479
_read('docs/CONTRIBUTORS.txt')).decode('utf-8'),
453
480
author='Alex Clark (fork author)',
454
481
author_email='aclark@aclark.net',
455
482
url='http://github.com/python-imaging/Pillow',
458
484
"Development Status :: 6 - Mature",
459
485
"Topic :: Multimedia :: Graphics",
462
488
"Topic :: Multimedia :: Graphics :: Capture :: Screen Capture",
463
489
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
464
490
"Topic :: Multimedia :: Graphics :: Viewers",
491
"Programming Language :: Python :: 2",
492
"Programming Language :: Python :: 2.6",
493
"Programming Language :: Python :: 2.7",
494
"Programming Language :: Python :: 3",
495
"Programming Language :: Python :: 3.2",
496
"Programming Language :: Python :: 3.3",
466
498
cmdclass={"build_ext": pil_build_ext},
467
499
ext_modules=[Extension("_imaging", ["_imaging.c"])],
468
500
packages=find_packages(),
469
501
scripts=glob.glob("Scripts/pil*.py"),
502
keywords=["Imaging",],
503
license='Standard PIL License',