mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 09:26:16 +03:00
py3k: Add .FLI sanity check, and fix palette bytes bug
This commit is contained in:
parent
9921d838e4
commit
6765b8e026
BIN
Images/lena.fli
Normal file
BIN
Images/lena.fli
Normal file
Binary file not shown.
|
@ -81,7 +81,7 @@ class FliImageFile(ImageFile.ImageFile):
|
|||
self._palette(palette, 0)
|
||||
|
||||
palette = [o8(r)+o8(g)+o8(b) for (r,g,b) in palette]
|
||||
self.palette = ImagePalette.raw("RGB", "".join(palette))
|
||||
self.palette = ImagePalette.raw("RGB", b"".join(palette))
|
||||
|
||||
# set things up to decode first frame
|
||||
self.frame = -1
|
||||
|
|
14
Tests/test_file_fli.py
Normal file
14
Tests/test_file_fli.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from tester import *
|
||||
|
||||
from PIL import Image
|
||||
|
||||
# sample ppm stream
|
||||
file = "Images/lena.fli"
|
||||
data = open(file, "rb").read()
|
||||
|
||||
def test_sanity():
|
||||
im = Image.open(file)
|
||||
im.load()
|
||||
assert_equal(im.mode, "P")
|
||||
assert_equal(im.size, (128, 128))
|
||||
assert_equal(im.format, "FLI")
|
Loading…
Reference in New Issue
Block a user