mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
reorganize imports to penalize file formats without accept
This commit is contained in:
parent
76d156bef0
commit
de4313f00b
16
PIL/Image.py
16
PIL/Image.py
|
@ -355,7 +355,11 @@ def preinit():
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from PIL import BmpImagePlugin
|
from PIL import JpegImagePlugin
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
from PIL import PngImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
|
@ -363,21 +367,13 @@ def preinit():
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from PIL import JpegImagePlugin
|
from PIL import BmpImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from PIL import PpmImagePlugin
|
from PIL import PpmImagePlugin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
|
||||||
from PIL import PngImagePlugin
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
# try:
|
|
||||||
# import TiffImagePlugin
|
|
||||||
# except ImportError:
|
|
||||||
# pass
|
|
||||||
|
|
||||||
_initialized = 1
|
_initialized = 1
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,18 @@ PILLOW_VERSION = '3.5.0.dev0' # Pillow
|
||||||
|
|
||||||
__version__ = PILLOW_VERSION
|
__version__ = PILLOW_VERSION
|
||||||
|
|
||||||
_plugins = ['BmpImagePlugin',
|
_plugins = [
|
||||||
|
#core
|
||||||
|
'JpegImagePlugin',
|
||||||
|
'PngImagePlugin',
|
||||||
|
'GifImagePlugin',
|
||||||
|
'BmpImagePlugin',
|
||||||
|
'PpmImagePlugin',
|
||||||
|
'TiffImagePlugin',
|
||||||
|
'WebPImagePlugin',
|
||||||
|
'Jpeg2KImagePlugin',
|
||||||
|
|
||||||
|
#non-core
|
||||||
'BufrStubImagePlugin',
|
'BufrStubImagePlugin',
|
||||||
'CurImagePlugin',
|
'CurImagePlugin',
|
||||||
'DcxImagePlugin',
|
'DcxImagePlugin',
|
||||||
|
@ -27,19 +38,12 @@ _plugins = ['BmpImagePlugin',
|
||||||
'FpxImagePlugin',
|
'FpxImagePlugin',
|
||||||
'FtexImagePlugin',
|
'FtexImagePlugin',
|
||||||
'GbrImagePlugin',
|
'GbrImagePlugin',
|
||||||
'GifImagePlugin',
|
|
||||||
'GribStubImagePlugin',
|
'GribStubImagePlugin',
|
||||||
'Hdf5StubImagePlugin',
|
'Hdf5StubImagePlugin',
|
||||||
'IcnsImagePlugin',
|
'IcnsImagePlugin',
|
||||||
'IcoImagePlugin',
|
'IcoImagePlugin',
|
||||||
'ImImagePlugin',
|
|
||||||
'ImtImagePlugin',
|
|
||||||
'IptcImagePlugin',
|
|
||||||
'JpegImagePlugin',
|
|
||||||
'Jpeg2KImagePlugin',
|
|
||||||
'McIdasImagePlugin',
|
'McIdasImagePlugin',
|
||||||
'MicImagePlugin',
|
'MicImagePlugin',
|
||||||
'MpegImagePlugin',
|
|
||||||
'MpoImagePlugin',
|
'MpoImagePlugin',
|
||||||
'MspImagePlugin',
|
'MspImagePlugin',
|
||||||
'PalmImagePlugin',
|
'PalmImagePlugin',
|
||||||
|
@ -47,16 +51,18 @@ _plugins = ['BmpImagePlugin',
|
||||||
'PcxImagePlugin',
|
'PcxImagePlugin',
|
||||||
'PdfImagePlugin',
|
'PdfImagePlugin',
|
||||||
'PixarImagePlugin',
|
'PixarImagePlugin',
|
||||||
'PngImagePlugin',
|
|
||||||
'PpmImagePlugin',
|
|
||||||
'PsdImagePlugin',
|
'PsdImagePlugin',
|
||||||
'SgiImagePlugin',
|
'SgiImagePlugin',
|
||||||
'SpiderImagePlugin',
|
|
||||||
'SunImagePlugin',
|
'SunImagePlugin',
|
||||||
'TgaImagePlugin',
|
|
||||||
'TiffImagePlugin',
|
|
||||||
'WebPImagePlugin',
|
|
||||||
'WmfImagePlugin',
|
'WmfImagePlugin',
|
||||||
'XbmImagePlugin',
|
'XbmImagePlugin',
|
||||||
'XpmImagePlugin',
|
'XpmImagePlugin',
|
||||||
'XVThumbImagePlugin']
|
'XVThumbImagePlugin'
|
||||||
|
#no _accept function
|
||||||
|
'ImImagePlugin',
|
||||||
|
'ImtImagePlugin',
|
||||||
|
'IptcImagePlugin',
|
||||||
|
'MpegImagePlugin',
|
||||||
|
'SpiderImagePlugin',
|
||||||
|
'TgaImagePlugin',
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user