28
28
"Geometry", "GetBBox", "GifDecode", "GifEncode", "HexDecode",
29
29
"Histo", "JpegDecode", "JpegEncode", "LzwDecode", "Matrix",
30
30
"ModeFilter", "MspDecode", "Negative", "Offset", "Pack",
31
"PackDecode", "Palette", "Paste", "Quant", "QuantHash",
31
"PackDecode", "Palette", "Paste", "Quant", "QuantOctree", "QuantHash",
32
32
"QuantHeap", "PcdDecode", "PcxDecode", "PcxEncode", "Point",
33
33
"RankFilter", "RawDecode", "RawEncode", "Storage", "SunRleDecode",
34
34
"TgaRleDecode", "Unpack", "UnpackYCC", "UnsharpMask", "XbmDecode",
35
"XbmEncode", "ZipDecode", "ZipEncode")
35
"XbmEncode", "ZipDecode", "ZipEncode", "TiffDecode")
38
38
def _add_directory(path, dir, where=None):
135
135
# add configured kits
137
for root in (TCL_ROOT, JPEG_ROOT, TCL_ROOT, TIFF_ROOT, ZLIB_ROOT,
137
for root in (TCL_ROOT, JPEG_ROOT, TIFF_ROOT, ZLIB_ROOT,
138
138
FREETYPE_ROOT, LCMS_ROOT):
139
139
if isinstance(root, type(())):
140
140
lib_root, include_root = root
235
237
# look for available libraries
238
zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
240
zlib = jpeg = tiff = freetype = tcl = tk = lcms = webp = None
239
241
feature = feature()
241
243
if _find_include_file(self, "zlib.h"):
254
256
if _find_library_file(self, "tiff"):
255
257
feature.tiff = "tiff"
258
if sys.platform == "win32" and _find_library_file(self, "libtiff"):
259
feature.tiff = "libtiff"
260
if sys.platform == "darwin" and _find_library_file(self, "libtiff"):
261
feature.tiff = "libtiff"
257
263
if _find_library_file(self, "freetype"):
258
264
# look for freetype2 include files
291
297
elif _find_library_file(self, "tk" + TCL_VERSION):
292
298
feature.tk = "tk" + TCL_VERSION
300
if _find_include_file(self, "webp/encode.h") and _find_include_file(self, "webp/decode.h"):
301
if _find_library_file(self, "webp"):
302
feature.webp = "webp"
309
319
libs.append(feature.zlib)
310
320
defs.append(("HAVE_LIBZ", None))
322
libs.append(feature.tiff)
323
defs.append(("HAVE_LIBTIFF", None))
311
324
if host_platform == "win32":
312
325
libs.extend(["kernel32", "user32", "gdi32"])
313
326
if struct.unpack("h", "\0\1".encode('ascii'))[0] == 1:
338
351
exts.append(Extension(
339
352
"_imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra))
341
if host_platform == "darwin":
354
if os.path.isfile("_webp.c") and feature.webp:
355
exts.append(Extension(
356
"_webp", ["_webp.c"], libraries=["webp"]))
359
if sys.platform == "darwin":
342
360
# locate Tcl/Tk frameworks
344
362
framework_roots = [
384
402
def summary_report(self, feature, unsafe_zlib):
387
print("SETUP SUMMARY (Pillow %s / PIL %s)" % (VERSION, PIL_VERSION))
405
print("SETUP SUMMARY (Pillow %s fork, originally based on PIL %s)" % (VERSION, PIL_VERSION))
389
print("version %s" % VERSION)
407
print("version %s (Pillow)" % VERSION)
390
408
v = sys.version.split("[")
391
409
print("platform %s %s" % (host_platform, v[0].strip()))
397
415
(feature.tcl and feature.tk, "TKINTER"),
398
416
(feature.jpeg, "JPEG"),
399
417
(feature.zlib, "ZLIB (PNG/ZIP)"),
400
# (feature.tiff, "experimental TIFF G3/G4 read"),
418
(feature.tiff, "TIFF G3/G4 (experimental)"),
401
419
(feature.freetype, "FREETYPE2"),
402
420
(feature.lcms, "LITTLECMS"),
421
(feature.webp, "WEBP"),
430
448
print("To add a missing option, make sure you have the required")
431
449
print("library, and set the corresponding ROOT variable in the")
432
450
print("setup.py script.")
435
453
print("To check the build, run the selftest.py script.")
437
456
def check_zlib_version(self, include_dirs):
438
457
# look for unsafe versions of zlib
479
498
description='Python Imaging Library (fork)',
480
499
long_description=(
481
_read('README.rst') +
482
_read('docs/INSTALL.txt') +
483
_read('docs/HISTORY.txt')).decode('utf-8'),
500
_read('README.rst') + b'\n' +
501
_read('docs/HISTORY.txt') + b'\n' +
502
_read('docs/CONTRIBUTORS.txt')).decode('utf-8'),
484
503
author='Alex Clark (fork author)',
485
504
author_email='aclark@aclark.net',
486
505
url='http://github.com/python-imaging/Pillow',
503
522
ext_modules=[Extension("_imaging", ["_imaging.c"])],
504
523
packages=find_packages(),
505
524
scripts=glob.glob("Scripts/pil*.py"),
525
keywords=["Imaging",],
526
license='Standard PIL License',