mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
Add testing for bmp 'questionable' files
This commit is contained in:
parent
05b5382a60
commit
e63b97ea42
BIN
Tests/images/bmp/q/rgb32bf-xbgr.bmp
Normal file
BIN
Tests/images/bmp/q/rgb32bf-xbgr.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -26,12 +26,26 @@ class TestBmpReference(PillowTestCase):
|
||||||
def test_questionable(self):
|
def test_questionable(self):
|
||||||
""" These shouldn't crash/dos, but it's not well defined that these
|
""" These shouldn't crash/dos, but it's not well defined that these
|
||||||
are in spec """
|
are in spec """
|
||||||
|
supported = [
|
||||||
|
"pal8os2v2.bmp",
|
||||||
|
"rgb24prof.bmp",
|
||||||
|
"pal1p1.bmp",
|
||||||
|
"pal8offs.bmp",
|
||||||
|
"rgb24lprof.bmp",
|
||||||
|
"rgb32fakealpha.bmp",
|
||||||
|
"rgb24largepal.bmp",
|
||||||
|
"pal8os2sp.bmp",
|
||||||
|
"rgb32bf-xbgr.bmp",
|
||||||
|
]
|
||||||
for f in self.get_files('q'):
|
for f in self.get_files('q'):
|
||||||
try:
|
try:
|
||||||
im = Image.open(f)
|
im = Image.open(f)
|
||||||
im.load()
|
im.load()
|
||||||
|
if os.path.basename(f) not in supported:
|
||||||
|
print("Please add %s to the partially supported bmp specs." % f)
|
||||||
except Exception: # as msg:
|
except Exception: # as msg:
|
||||||
pass
|
if os.path.basename(f) in supported:
|
||||||
|
raise
|
||||||
# print ("Bad Image %s: %s" %(f,msg))
|
# print ("Bad Image %s: %s" %(f,msg))
|
||||||
|
|
||||||
def test_good(self):
|
def test_good(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user