mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	merged pull request #88 to master, resolved conflicts
This commit is contained in:
		
							parent
							
								
									e969b5ae14
								
							
						
					
					
						commit
						c774f9ab4c
					
				| 
						 | 
				
			
			@ -53,7 +53,7 @@ try:
 | 
			
		|||
    # the "open" function to identify files, but you cannot load
 | 
			
		||||
    # them.  Note that other modules should not refer to _imaging
 | 
			
		||||
    # directly; import Image and use the Image.core variable instead.
 | 
			
		||||
    import _imaging as core
 | 
			
		||||
    from . import _imaging as core
 | 
			
		||||
except ImportError as v:
 | 
			
		||||
    core = _imaging_not_installed()
 | 
			
		||||
    if str(v)[:20] == "Module use of python" and warnings:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ VERSION = "0.1.0 pil"
 | 
			
		|||
# --------------------------------------------------------------------.
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
import _imagingcms
 | 
			
		||||
from . import _imagingcms
 | 
			
		||||
 | 
			
		||||
core = _imagingcms
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -315,7 +315,7 @@ def getdraw(im=None, hints=None):
 | 
			
		|||
    handler = None
 | 
			
		||||
    if not hints or "nicest" in hints:
 | 
			
		||||
        try:
 | 
			
		||||
            import _imagingagg as handler
 | 
			
		||||
            from PIL import _imagingagg as handler
 | 
			
		||||
        except ImportError:
 | 
			
		||||
            pass
 | 
			
		||||
    if handler is None:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ class _imagingft_not_installed:
 | 
			
		|||
        raise ImportError("The _imagingft C module is not installed")
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    import _imagingft as core
 | 
			
		||||
    from PIL import _imagingft as core
 | 
			
		||||
except ImportError:
 | 
			
		||||
    core = _imagingft_not_installed()
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,7 +17,7 @@
 | 
			
		|||
# extensions.)
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
import _imaginggl
 | 
			
		||||
from . import _imaginggl
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
# Texture factory.
 | 
			
		||||
| 
						 | 
				
			
			@ -25,4 +25,4 @@ import _imaginggl
 | 
			
		|||
class TextureFactory:
 | 
			
		||||
    pass # overwritten by the _imaginggl module
 | 
			
		||||
 | 
			
		||||
from _imaginggl import *
 | 
			
		||||
from ._imaginggl import *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@
 | 
			
		|||
#
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
import _imagingmath
 | 
			
		||||
from . import _imagingmath
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,9 @@
 | 
			
		|||
try:
 | 
			
		||||
    import tkinter
 | 
			
		||||
except ImportError:
 | 
			
		||||
    import Tkinter as tkinter
 | 
			
		||||
    import Tkinter
 | 
			
		||||
    tkinter = Tkinter
 | 
			
		||||
    del Tkinter
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -183,7 +185,7 @@ class PhotoImage:
 | 
			
		|||
        except tkinter.TclError as v:
 | 
			
		||||
            # activate Tkinter hook
 | 
			
		||||
            try:
 | 
			
		||||
                import _imagingtk
 | 
			
		||||
                from PIL import _imagingtk
 | 
			
		||||
                try:
 | 
			
		||||
                    _imagingtk.tkinit(tk.interpaddr(), 1)
 | 
			
		||||
                except AttributeError:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -182,13 +182,13 @@ if __name__ == "__main__":
 | 
			
		|||
    print("Python modules loaded from", os.path.dirname(Image.__file__))
 | 
			
		||||
    print("Binary modules loaded from", os.path.dirname(Image.core.__file__))
 | 
			
		||||
    print("-"*68)
 | 
			
		||||
    check_module("PIL CORE", "_imaging")
 | 
			
		||||
    check_module("TKINTER", "_imagingtk")
 | 
			
		||||
    check_module("PIL CORE", "PIL._imaging")
 | 
			
		||||
    check_module("TKINTER", "PIL._imagingtk")
 | 
			
		||||
    check_codec("JPEG", "jpeg")
 | 
			
		||||
    check_codec("ZLIB (PNG/ZIP)", "zip")
 | 
			
		||||
    check_codec("G4 TIFF", "group4")
 | 
			
		||||
    check_module("FREETYPE2", "_imagingft")
 | 
			
		||||
    check_module("LITTLECMS", "_imagingcms")
 | 
			
		||||
    check_module("FREETYPE2", "PIL._imagingft")
 | 
			
		||||
    check_module("LITTLECMS", "PIL._imagingcms")
 | 
			
		||||
    check_module("WEBP", "_webp")
 | 
			
		||||
    print("-"*68)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										16
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								setup.py
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -304,7 +304,7 @@ class pil_build_ext(build_ext):
 | 
			
		|||
            defs.append(("WORDS_BIGENDIAN", None))
 | 
			
		||||
 | 
			
		||||
        exts = [(Extension(
 | 
			
		||||
            "_imaging", files, libraries=libs, define_macros=defs))]
 | 
			
		||||
            "PIL._imaging", files, libraries=libs, define_macros=defs))]
 | 
			
		||||
 | 
			
		||||
        #
 | 
			
		||||
        # additional libraries
 | 
			
		||||
| 
						 | 
				
			
			@ -314,19 +314,19 @@ class pil_build_ext(build_ext):
 | 
			
		|||
            if feature.freetype_version == 20:
 | 
			
		||||
                defs.append(("USE_FREETYPE_2_0", None))
 | 
			
		||||
            exts.append(Extension(
 | 
			
		||||
                "_imagingft", ["_imagingft.c"], libraries=["freetype"],
 | 
			
		||||
                "PIL._imagingft", ["_imagingft.c"], libraries=["freetype"],
 | 
			
		||||
                define_macros=defs))
 | 
			
		||||
 | 
			
		||||
        if os.path.isfile("_imagingtiff.c") and feature.tiff:
 | 
			
		||||
            exts.append(Extension(
 | 
			
		||||
                "_imagingtiff", ["_imagingtiff.c"], libraries=["tiff"]))
 | 
			
		||||
                "PIL._imagingtiff", ["_imagingtiff.c"], libraries=["tiff"]))
 | 
			
		||||
 | 
			
		||||
        if os.path.isfile("_imagingcms.c") and feature.lcms:
 | 
			
		||||
            extra = []
 | 
			
		||||
            if sys.platform == "win32":
 | 
			
		||||
                extra.extend(["user32", "gdi32"])
 | 
			
		||||
            exts.append(Extension(
 | 
			
		||||
                "_imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra))
 | 
			
		||||
                "PIL._imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra))
 | 
			
		||||
 | 
			
		||||
        if os.path.isfile("_webp.c") and feature.webp:
 | 
			
		||||
            exts.append(Extension(
 | 
			
		||||
| 
						 | 
				
			
			@ -351,16 +351,16 @@ class pil_build_ext(build_ext):
 | 
			
		|||
                    break
 | 
			
		||||
            if frameworks:
 | 
			
		||||
                exts.append(Extension(
 | 
			
		||||
                    "_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
 | 
			
		||||
                    "PIL._imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
 | 
			
		||||
                    extra_compile_args=frameworks, extra_link_args=frameworks))
 | 
			
		||||
                feature.tcl = feature.tk = 1  # mark as present
 | 
			
		||||
        elif feature.tcl and feature.tk:
 | 
			
		||||
            exts.append(Extension(
 | 
			
		||||
                "_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
 | 
			
		||||
                "PIL._imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"],
 | 
			
		||||
                libraries=[feature.tcl, feature.tk]))
 | 
			
		||||
 | 
			
		||||
        if os.path.isfile("_imagingmath.c"):
 | 
			
		||||
            exts.append(Extension("_imagingmath", ["_imagingmath.c"]))
 | 
			
		||||
            exts.append(Extension("PIL._imagingmath", ["_imagingmath.c"]))
 | 
			
		||||
 | 
			
		||||
        self.extensions[:] = exts
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -494,7 +494,7 @@ setup(
 | 
			
		|||
        "Programming Language :: Python :: 3.3",
 | 
			
		||||
        ],
 | 
			
		||||
    cmdclass={"build_ext": pil_build_ext},
 | 
			
		||||
    ext_modules=[Extension("_imaging", ["_imaging.c"])],
 | 
			
		||||
    ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
 | 
			
		||||
    packages=find_packages(),
 | 
			
		||||
    scripts=glob.glob("Scripts/pil*.py"),
 | 
			
		||||
    keywords=["Imaging",],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user