diff --git a/Images/lena.fli b/Images/lena.fli new file mode 100644 index 000000000..2c7367e22 Binary files /dev/null and b/Images/lena.fli differ diff --git a/PIL/FliImagePlugin.py b/PIL/FliImagePlugin.py index 4c16b0e04..6af61c6e6 100644 --- a/PIL/FliImagePlugin.py +++ b/PIL/FliImagePlugin.py @@ -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 diff --git a/Tests/test_file_fli.py b/Tests/test_file_fli.py new file mode 100644 index 000000000..4e06a732e --- /dev/null +++ b/Tests/test_file_fli.py @@ -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")