Replaced absolute PIL import with relative import

This commit is contained in:
Andrew Murray 2023-05-20 17:11:43 +10:00
parent 599979caae
commit 546f6cbc27
4 changed files with 8 additions and 8 deletions

View File

@ -22,11 +22,11 @@ import os
import struct
import sys
from PIL import Image, ImageFile, PngImagePlugin, features
from . import Image, ImageFile, PngImagePlugin, features
enable_jpeg2k = features.check_codec("jpg_2000")
if enable_jpeg2k:
from PIL import Jpeg2KImagePlugin
from . import Jpeg2KImagePlugin
MAGIC = b"icns"
HEADERSIZE = 8

View File

@ -18,10 +18,10 @@
import sys
from enum import IntEnum
from PIL import Image
from . import Image
try:
from PIL import _imagingcms
from . import _imagingcms
except ImportError as ex:
# Allow error import for doc purposes, but error out when accessing
# anything in core.
@ -271,7 +271,7 @@ def get_display_profile(handle=None):
if sys.platform != "win32":
return None
from PIL import ImageWin
from . import ImageWin
if isinstance(handle, ImageWin.HDC):
profile = core.get_display_profile_win32(handle, 1)

View File

@ -17,7 +17,7 @@ import subprocess
import sys
from shlex import quote
from PIL import Image
from . import Image
_viewers = []

View File

@ -36,7 +36,7 @@ import os
import struct
import sys
from PIL import Image, ImageFile
from . import Image, ImageFile
def isInt(f):
@ -191,7 +191,7 @@ class SpiderImageFile(ImageFile.ImageFile):
# returns a ImageTk.PhotoImage object, after rescaling to 0..255
def tkPhotoImage(self):
from PIL import ImageTk
from . import ImageTk
return ImageTk.PhotoImage(self.convert2byte(), palette=256)