mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Fix imports
This commit is contained in:
parent
de957b6382
commit
3020c16eaa
|
@ -22,9 +22,9 @@ from __future__ import print_function
|
||||||
|
|
||||||
__version__ = "0.4"
|
__version__ = "0.4"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette
|
from PIL import Image, ImageFile, ImagePalette
|
||||||
|
|
||||||
from .PngImagePlugin import i8, i16, i32, ChunkStream, _MODES
|
from PIL.PngImagePlugin import i8, i16, i32, ChunkStream, _MODES
|
||||||
|
|
||||||
MAGIC = b"\212ARG\r\n\032\n"
|
MAGIC = b"\212ARG\r\n\032\n"
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
from . import FontFile
|
from PIL import FontFile
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
__version__ = "0.7"
|
__version__ = "0.7"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
i16 = _binary.i16le
|
i16 = _binary.i16le
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
_handler = None
|
_handler = None
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, BmpImagePlugin, _binary
|
from PIL import Image, BmpImagePlugin, _binary
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
||||||
from . import Image, _binary
|
from PIL import Image, _binary
|
||||||
|
|
||||||
from .PcxImagePlugin import PcxImageFile
|
from PIL.PcxImagePlugin import PcxImageFile
|
||||||
|
|
||||||
MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then?
|
MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then?
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ __version__ = "0.5"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import io
|
import io
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
_handler = None
|
_handler = None
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
i16 = _binary.i16le
|
i16 = _binary.i16le
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from . import Image, _binary
|
from PIL import Image, _binary
|
||||||
|
|
||||||
import marshal
|
import marshal
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
from .OleFileIO import *
|
from PIL.OleFileIO import *
|
||||||
|
|
||||||
|
|
||||||
# we map from colour field tuples to (mode, rawmode) descriptors
|
# we map from colour field tuples to (mode, rawmode) descriptors
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
i32 = _binary.i32be
|
i32 = _binary.i32be
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import ImageFile, ImagePalette, _binary
|
from PIL import ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import builtins
|
import builtins
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
__version__ = "0.9"
|
__version__ = "0.9"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from math import pi, log, sin, sqrt
|
from math import pi, log, sin, sqrt
|
||||||
from ._binary import o8
|
from PIL._binary import o8
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Stuff to translate curve segments to palette values (derived from
|
# Stuff to translate curve segments to palette values (derived from
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from ._binary import o8
|
from PIL._binary import o8
|
||||||
|
|
||||||
##
|
##
|
||||||
# File handler for GIMP's palette format.
|
# File handler for GIMP's palette format.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
_handler = None
|
_handler = None
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
_handler = None
|
_handler = None
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, BmpImagePlugin, _binary
|
from PIL import Image, BmpImagePlugin, _binary
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -29,8 +29,8 @@
|
||||||
__version__ = "0.7"
|
__version__ = "0.7"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from . import Image, ImageFile, ImagePalette
|
from PIL import Image, ImageFile, ImagePalette
|
||||||
from ._binary import i8, o8
|
from PIL._binary import i8, o8
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
26
PIL/Image.py
26
PIL/Image.py
|
@ -72,8 +72,8 @@ except ImportError:
|
||||||
import __builtin__
|
import __builtin__
|
||||||
builtins = __builtin__
|
builtins = __builtin__
|
||||||
|
|
||||||
from . import ImageMode
|
from PIL import ImageMode
|
||||||
from ._binary import i8, o8
|
from PIL._binary import i8, o8
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
|
@ -279,23 +279,23 @@ def preinit():
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from . import BmpImagePlugin
|
from PIL import BmpImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from . import GifImagePlugin
|
from PIL import GifImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from . import JpegImagePlugin
|
from PIL import JpegImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from . import PpmImagePlugin
|
from PIL import PpmImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from . import PngImagePlugin
|
from PIL import PngImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
# try:
|
# try:
|
||||||
|
@ -453,7 +453,7 @@ class Image:
|
||||||
new.size = im.size
|
new.size = im.size
|
||||||
new.palette = self.palette
|
new.palette = self.palette
|
||||||
if im.mode == "P":
|
if im.mode == "P":
|
||||||
from . import ImagePalette
|
from PIL import ImagePalette
|
||||||
new.palette = ImagePalette.ImagePalette()
|
new.palette = ImagePalette.ImagePalette()
|
||||||
try:
|
try:
|
||||||
new.info = self.info.copy()
|
new.info = self.info.copy()
|
||||||
|
@ -1025,7 +1025,7 @@ class Image:
|
||||||
"'offset' is deprecated; use 'ImageChops.offset' instead",
|
"'offset' is deprecated; use 'ImageChops.offset' instead",
|
||||||
DeprecationWarning, stacklevel=2
|
DeprecationWarning, stacklevel=2
|
||||||
)
|
)
|
||||||
from . import ImageChops
|
from PIL import ImageChops
|
||||||
return ImageChops.offset(self, xoffset, yoffset)
|
return ImageChops.offset(self, xoffset, yoffset)
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -1092,7 +1092,7 @@ class Image:
|
||||||
box = box + (box[0]+size[0], box[1]+size[1])
|
box = box + (box[0]+size[0], box[1]+size[1])
|
||||||
|
|
||||||
if isStringType(im):
|
if isStringType(im):
|
||||||
from . import ImageColor
|
from PIL import ImageColor
|
||||||
im = ImageColor.getcolor(im, self.mode)
|
im = ImageColor.getcolor(im, self.mode)
|
||||||
|
|
||||||
elif isImageType(im):
|
elif isImageType(im):
|
||||||
|
@ -1238,7 +1238,7 @@ class Image:
|
||||||
|
|
||||||
def putpalette(self, data, rawmode="RGB"):
|
def putpalette(self, data, rawmode="RGB"):
|
||||||
"Put palette data into an image."
|
"Put palette data into an image."
|
||||||
from . import ImagePalette
|
from PIL import ImagePalette
|
||||||
|
|
||||||
if self.mode not in ("L", "P"):
|
if self.mode not in ("L", "P"):
|
||||||
raise ValueError("illegal image mode")
|
raise ValueError("illegal image mode")
|
||||||
|
@ -1772,7 +1772,7 @@ def new(mode, size, color=0):
|
||||||
if isStringType(color):
|
if isStringType(color):
|
||||||
# css3-style specifier
|
# css3-style specifier
|
||||||
|
|
||||||
from . import ImageColor
|
from PIL import ImageColor
|
||||||
color = ImageColor.getcolor(color, mode)
|
color = ImageColor.getcolor(color, mode)
|
||||||
|
|
||||||
return Image()._new(core.fill(mode, size, color))
|
return Image()._new(core.fill(mode, size, color))
|
||||||
|
@ -2165,5 +2165,5 @@ def _show(image, **options):
|
||||||
_showxv(image, **options)
|
_showxv(image, **options)
|
||||||
|
|
||||||
def _showxv(image, title=None, **options):
|
def _showxv(image, title=None, **options):
|
||||||
from . import ImageShow
|
from PIL import ImageShow
|
||||||
ImageShow.show(image, title, **options)
|
ImageShow.show(image, title, **options)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
##
|
##
|
||||||
# The <b>ImageChops</b> module contains a number of arithmetical image
|
# The <b>ImageChops</b> module contains a number of arithmetical image
|
||||||
|
|
|
@ -81,7 +81,7 @@ VERSION = "0.1.0 pil"
|
||||||
|
|
||||||
# --------------------------------------------------------------------.
|
# --------------------------------------------------------------------.
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import _imagingcms
|
import _imagingcms
|
||||||
|
|
||||||
core = _imagingcms
|
core = _imagingcms
|
||||||
|
@ -207,7 +207,7 @@ class ImageCmsTransform(Image.ImagePointHandler):
|
||||||
def get_display_profile(handle=None):
|
def get_display_profile(handle=None):
|
||||||
import sys
|
import sys
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
from . import ImageWin
|
from PIL import ImageWin
|
||||||
if isinstance(handle, ImageWin.HDC):
|
if isinstance(handle, ImageWin.HDC):
|
||||||
profile = core.get_display_profile_win32(handle, 1)
|
profile = core.get_display_profile_win32(handle, 1)
|
||||||
else:
|
else:
|
||||||
|
@ -771,7 +771,7 @@ def versions():
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# create a cheap manual from the __doc__ strings for the functions above
|
# create a cheap manual from the __doc__ strings for the functions above
|
||||||
|
|
||||||
from . import ImageCms
|
from PIL import ImageCms
|
||||||
print(__doc__)
|
print(__doc__)
|
||||||
|
|
||||||
for f in dir(pyCMS):
|
for f in dir(pyCMS):
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageColor
|
from PIL import Image, ImageColor
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import warnings
|
import warnings
|
||||||
|
@ -127,7 +127,7 @@ class ImageDraw:
|
||||||
def getfont(self):
|
def getfont(self):
|
||||||
if not self.font:
|
if not self.font:
|
||||||
# FIXME: should add a font repository
|
# FIXME: should add a font repository
|
||||||
from . import ImageFont
|
from PIL import ImageFont
|
||||||
self.font = ImageFont.load_default()
|
self.font = ImageFont.load_default()
|
||||||
return self.font
|
return self.font
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ def getdraw(im=None, hints=None):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
if handler is None:
|
if handler is None:
|
||||||
from . import ImageDraw2
|
from PIL import ImageDraw2
|
||||||
handler = ImageDraw2
|
handler = ImageDraw2
|
||||||
if im:
|
if im:
|
||||||
im = handler.Draw(im)
|
im = handler.Draw(im)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageColor, ImageDraw, ImageFont, ImagePath
|
from PIL import Image, ImageColor, ImageDraw, ImageFont, ImagePath
|
||||||
|
|
||||||
class Pen:
|
class Pen:
|
||||||
def __init__(self, color, width=1, opacity=255):
|
def __init__(self, color, width=1, opacity=255):
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image, ImageFilter, ImageStat
|
from PIL import Image, ImageFilter, ImageStat
|
||||||
|
|
||||||
class _Enhance:
|
class _Enhance:
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import traceback, os
|
import traceback, os
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
class _imagingft_not_installed:
|
class _imagingft_not_installed:
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
##
|
##
|
||||||
# (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy
|
# (New in 1.1.3) The <b>ImageGrab</b> module can be used to copy
|
||||||
|
@ -66,7 +66,7 @@ def grabclipboard():
|
||||||
debug = 0 # temporary interface
|
debug = 0 # temporary interface
|
||||||
data = Image.core.grabclipboard(debug)
|
data = Image.core.grabclipboard(debug)
|
||||||
if isinstance(data, bytes):
|
if isinstance(data, bytes):
|
||||||
from . import BmpImagePlugin
|
from PIL import BmpImagePlugin
|
||||||
import io
|
import io
|
||||||
return BmpImagePlugin.DibImageFile(io.BytesIO(data))
|
return BmpImagePlugin.DibImageFile(io.BytesIO(data))
|
||||||
return data
|
return data
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import _imagingmath
|
import _imagingmath
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ModeDescriptor:
|
||||||
def getmode(mode):
|
def getmode(mode):
|
||||||
if not _modes:
|
if not _modes:
|
||||||
# initialize mode cache
|
# initialize mode cache
|
||||||
from . import Image
|
from PIL import Image
|
||||||
# core modes
|
# core modes
|
||||||
for m, (basemode, basetype, bands) in Image._MODEINFO.items():
|
for m, (basemode, basetype, bands) in Image._MODEINFO.items():
|
||||||
_modes[m] = ModeDescriptor(m, bands, basemode, basetype)
|
_modes[m] = ModeDescriptor(m, bands, basemode, basetype)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import operator
|
import operator
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import array
|
import array
|
||||||
from . import Image, ImageColor
|
from PIL import Image, ImageColor
|
||||||
|
|
||||||
##
|
##
|
||||||
# Colour palette wrapper for palette mapped images.
|
# Colour palette wrapper for palette mapped images.
|
||||||
|
@ -153,7 +153,7 @@ def load(filename):
|
||||||
|
|
||||||
if not lut:
|
if not lut:
|
||||||
try:
|
try:
|
||||||
from . import GimpPaletteFile
|
from PIL import GimpPaletteFile
|
||||||
fp.seek(0)
|
fp.seek(0)
|
||||||
p = GimpPaletteFile.GimpPaletteFile(fp)
|
p = GimpPaletteFile.GimpPaletteFile(fp)
|
||||||
lut = p.getpalette()
|
lut = p.getpalette()
|
||||||
|
@ -164,7 +164,7 @@ def load(filename):
|
||||||
|
|
||||||
if not lut:
|
if not lut:
|
||||||
try:
|
try:
|
||||||
from . import GimpGradientFile
|
from PIL import GimpGradientFile
|
||||||
fp.seek(0)
|
fp.seek(0)
|
||||||
p = GimpGradientFile.GimpGradientFile(fp)
|
p = GimpGradientFile.GimpGradientFile(fp)
|
||||||
lut = p.getpalette()
|
lut = p.getpalette()
|
||||||
|
@ -175,7 +175,7 @@ def load(filename):
|
||||||
|
|
||||||
if not lut:
|
if not lut:
|
||||||
try:
|
try:
|
||||||
from . import PaletteFile
|
from PIL import PaletteFile
|
||||||
fp.seek(0)
|
fp.seek(0)
|
||||||
p = PaletteFile.PaletteFile(fp)
|
p = PaletteFile.PaletteFile(fp)
|
||||||
lut = p.getpalette()
|
lut = p.getpalette()
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
##
|
##
|
||||||
# Path wrapper.
|
# Path wrapper.
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
from PyQt4.QtGui import QImage, qRgb
|
from PyQt4.QtGui import QImage, qRgb
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
_viewers = []
|
_viewers = []
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
import operator, math
|
import operator, math
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ except ImportError:
|
||||||
tkinter = Tkinter
|
tkinter = Tkinter
|
||||||
del Tkinter
|
del Tkinter
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
##
|
##
|
||||||
# The <b>ImageTk</b> module contains support to create and modify
|
# The <b>ImageTk</b> module contains support to create and modify
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
class Transform(Image.ImageTransformHandler):
|
class Transform(Image.ImageTransformHandler):
|
||||||
def __init__(self, data):
|
def __init__(self, data):
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
from . import Image
|
from PIL import Image
|
||||||
|
|
||||||
##
|
##
|
||||||
# The <b>ImageWin</b> module contains support to create and display
|
# The <b>ImageWin</b> module contains support to create and display
|
||||||
|
|
|
@ -19,7 +19,7 @@ __version__ = "0.2"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||||
__version__ = "0.3"
|
__version__ = "0.3"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
import os, tempfile
|
import os, tempfile
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
|
@ -217,7 +217,7 @@ Image.register_extension("IPTC", ".iim")
|
||||||
|
|
||||||
def getiptcinfo(im):
|
def getiptcinfo(im):
|
||||||
|
|
||||||
from . import TiffImagePlugin, JpegImagePlugin
|
from PIL import TiffImagePlugin, JpegImagePlugin
|
||||||
import io
|
import io
|
||||||
|
|
||||||
data = None
|
data = None
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
__version__ = "0.6"
|
__version__ = "0.6"
|
||||||
|
|
||||||
import array, struct
|
import array, struct
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
o8 = _binary.o8
|
o8 = _binary.o8
|
||||||
|
@ -360,7 +360,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
||||||
# Extract EXIF information. This method is highly experimental,
|
# Extract EXIF information. This method is highly experimental,
|
||||||
# and is likely to be replaced with something better in a future
|
# and is likely to be replaced with something better in a future
|
||||||
# version.
|
# version.
|
||||||
from . import TiffImagePlugin
|
from PIL import TiffImagePlugin
|
||||||
import io
|
import io
|
||||||
def fixup(value):
|
def fixup(value):
|
||||||
if len(value) == 1:
|
if len(value) == 1:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
def _accept(s):
|
def _accept(s):
|
||||||
return s[:8] == b"\x00\x00\x00\x00\x00\x00\x00\x04"
|
return s[:8] == b"\x00\x00\x00\x00\x00\x00\x00\x04"
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, TiffImagePlugin
|
from PIL import Image, TiffImagePlugin
|
||||||
from .OleFileIO import *
|
from PIL.OleFileIO import *
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
from ._binary import i8
|
from PIL._binary import i8
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bitstream parser
|
# Bitstream parser
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -40,7 +40,7 @@ from __future__ import print_function
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import sys
|
import sys
|
||||||
from . import _binary
|
from PIL import _binary
|
||||||
|
|
||||||
if str is not bytes:
|
if str is not bytes:
|
||||||
long = int
|
long = int
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from . import EpsImagePlugin
|
from PIL import EpsImagePlugin
|
||||||
|
|
||||||
##
|
##
|
||||||
# Simple Postscript graphics interface.
|
# Simple Postscript graphics interface.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from ._binary import o8
|
from PIL._binary import o8
|
||||||
|
|
||||||
##
|
##
|
||||||
# File handler for Teragon-style palette files.
|
# File handler for Teragon-style palette files.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
__version__ = "1.0"
|
__version__ = "1.0"
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
_Palm8BitColormapValues = (
|
_Palm8BitColormapValues = (
|
||||||
( 255, 255, 255 ), ( 255, 204, 255 ), ( 255, 153, 255 ), ( 255, 102, 255 ),
|
( 255, 255, 255 ), ( 255, 204, 255 ), ( 255, 153, 255 ), ( 255, 102, 255 ),
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import Image
|
from PIL import Image
|
||||||
from . import FontFile
|
from PIL import FontFile
|
||||||
from . import _binary
|
from PIL import _binary
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# declarations
|
# declarations
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
__version__ = "0.6"
|
__version__ = "0.6"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
i16 = _binary.i16le
|
i16 = _binary.i16le
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
__version__ = "0.4"
|
__version__ = "0.4"
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
from ._binary import i8
|
from PIL._binary import i8
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
#
|
#
|
||||||
# helpers
|
# helpers
|
||||||
|
|
|
@ -37,7 +37,7 @@ __version__ = "0.9"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
|
|
|
@ -19,7 +19,7 @@ __version__ = "0.2"
|
||||||
|
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
#
|
#
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
__version__ = "0.4"
|
__version__ = "0.4"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
MODES = {
|
MODES = {
|
||||||
# (photoshop mode, bits) -> (pil mode, required channels)
|
# (photoshop mode, bits) -> (pil mode, required channels)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
i8 = _binary.i8
|
i8 = _binary.i8
|
||||||
i16 = _binary.i16be
|
i16 = _binary.i16be
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
import os, struct, sys
|
import os, struct, sys
|
||||||
|
|
||||||
def isInt(f):
|
def isInt(f):
|
||||||
|
@ -173,7 +173,7 @@ class SpiderImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
# returns a ImageTk.PhotoImage object, after rescaling to 0..255
|
# returns a ImageTk.PhotoImage object, after rescaling to 0..255
|
||||||
def tkPhotoImage(self):
|
def tkPhotoImage(self):
|
||||||
from . import ImageTk
|
from PIL import ImageTk
|
||||||
return ImageTk.PhotoImage(self.convert2byte(), palette=256)
|
return ImageTk.PhotoImage(self.convert2byte(), palette=256)
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
__version__ = "0.3"
|
__version__ = "0.3"
|
||||||
|
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
i16 = _binary.i16be
|
i16 = _binary.i16be
|
||||||
i32 = _binary.i32be
|
i32 = _binary.i32be
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# See the README file for information on usage and redistribution.
|
# See the README file for information on usage and redistribution.
|
||||||
#
|
#
|
||||||
|
|
||||||
from . import ContainerIO
|
from PIL import ContainerIO
|
||||||
|
|
||||||
##
|
##
|
||||||
# A file object that provides read access to a given member of a TAR
|
# A file object that provides read access to a given member of a TAR
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
__version__ = "0.3"
|
__version__ = "0.3"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -43,9 +43,9 @@ from __future__ import print_function
|
||||||
|
|
||||||
__version__ = "1.3.5"
|
__version__ = "1.3.5"
|
||||||
|
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
from . import ImagePalette
|
from PIL import ImagePalette
|
||||||
from . import _binary
|
from PIL import _binary
|
||||||
|
|
||||||
import array, sys
|
import array, sys
|
||||||
import collections
|
import collections
|
||||||
|
@ -232,7 +232,7 @@ class ImageFileDirectory(collections.MutableMapping):
|
||||||
|
|
||||||
def named(self):
|
def named(self):
|
||||||
"""Returns the complete tag dictionary, with named tags where posible."""
|
"""Returns the complete tag dictionary, with named tags where posible."""
|
||||||
from . import TiffTags
|
from PIL import TiffTags
|
||||||
result = {}
|
result = {}
|
||||||
for tag_code, value in self.items():
|
for tag_code, value in self.items():
|
||||||
tag_name = TiffTags.TAGS.get(tag_code, tag_code)
|
tag_name = TiffTags.TAGS.get(tag_code, tag_code)
|
||||||
|
@ -362,7 +362,7 @@ class ImageFileDirectory(collections.MutableMapping):
|
||||||
tag, typ = i16(ifd), i16(ifd, 2)
|
tag, typ = i16(ifd), i16(ifd, 2)
|
||||||
|
|
||||||
if Image.DEBUG:
|
if Image.DEBUG:
|
||||||
from . import TiffTags
|
from PIL import TiffTags
|
||||||
tagname = TiffTags.TAGS.get(tag, "unknown")
|
tagname = TiffTags.TAGS.get(tag, "unknown")
|
||||||
typname = TiffTags.TYPES.get(typ, "unknown")
|
typname = TiffTags.TYPES.get(typ, "unknown")
|
||||||
print("tag: %s (%d)" % (tagname, tag), end=' ')
|
print("tag: %s (%d)" % (tagname, tag), end=' ')
|
||||||
|
@ -458,7 +458,7 @@ class ImageFileDirectory(collections.MutableMapping):
|
||||||
data = b"".join(map(o32, value))
|
data = b"".join(map(o32, value))
|
||||||
|
|
||||||
if Image.DEBUG:
|
if Image.DEBUG:
|
||||||
from . import TiffTags
|
from PIL import TiffTags
|
||||||
tagname = TiffTags.TAGS.get(tag, "unknown")
|
tagname = TiffTags.TAGS.get(tag, "unknown")
|
||||||
typname = TiffTags.TYPES.get(typ, "unknown")
|
typname = TiffTags.TYPES.get(typ, "unknown")
|
||||||
print("save: %s (%d)" % (tagname, tag), end=' ')
|
print("save: %s (%d)" % (tagname, tag), end=' ')
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
from . import Image, _binary
|
from PIL import Image, _binary
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import builtins
|
import builtins
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
__version__ = "0.2"
|
__version__ = "0.2"
|
||||||
|
|
||||||
from . import Image, ImageFile, _binary
|
from PIL import Image, ImageFile, _binary
|
||||||
|
|
||||||
_handler = None
|
_handler = None
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
__version__ = "0.1"
|
__version__ = "0.1"
|
||||||
|
|
||||||
from . import Image, ImageFile, ImagePalette, _binary
|
from PIL import Image, ImageFile, ImagePalette, _binary
|
||||||
|
|
||||||
o8 = _binary.o8
|
o8 = _binary.o8
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
__version__ = "0.6"
|
__version__ = "0.6"
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from . import Image, ImageFile
|
from PIL import Image, ImageFile
|
||||||
|
|
||||||
# XBM header
|
# XBM header
|
||||||
xbm_head = re.compile(
|
xbm_head = re.compile(
|
||||||
|
|
|
@ -19,8 +19,8 @@ __version__ = "0.2"
|
||||||
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from . import Image, ImageFile, ImagePalette
|
from PIL import Image, ImageFile, ImagePalette
|
||||||
from ._binary import i8, o8
|
from PIL._binary import i8, o8
|
||||||
|
|
||||||
# XPM header
|
# XPM header
|
||||||
xpm_head = re.compile(b"\"([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)")
|
xpm_head = re.compile(b"\"([0-9]*) ([0-9]*) ([0-9]*) ([0-9]*)")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user