mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from helper import unittest, PillowTestCase
|
|
|
|
from PIL import Image
|
|
|
|
PIL151 = b"""
|
|
#define basic_width 32
|
|
#define basic_height 32
|
|
static char basic_bits[] = {
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00,
|
|
0x80, 0xff, 0xff, 0x01, 0x40, 0x00, 0x00, 0x02,
|
|
0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08,
|
|
0x10, 0x00, 0x00, 0x08,
|
|
0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
|
|
0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x08,
|
|
0x20, 0x00, 0x00, 0x04,
|
|
0x20, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x02,
|
|
0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00,
|
|
};
|
|
"""
|
|
|
|
|
|
class TestFileXbm(PillowTestCase):
|
|
|
|
def test_pil151(self):
|
|
from io import BytesIO
|
|
|
|
im = Image.open(BytesIO(PIL151))
|
|
|
|
im.load()
|
|
self.assertEqual(im.mode, '1')
|
|
self.assertEqual(im.size, (32, 32))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|