diff --git a/PIL/ImageFileIO.py b/PIL/ImageFileIO.py deleted file mode 100644 index e57d3f43e..000000000 --- a/PIL/ImageFileIO.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# The Python Imaging Library. -# $Id$ -# -# kludge to get basic ImageFileIO functionality -# -# History: -# 1998-08-06 fl Recreated -# -# Copyright (c) Secret Labs AB 1998-2002. -# -# See the README file for information on usage and redistribution. -# -""" -The **ImageFileIO** module can be used to read an image from a -socket, or any other stream device. - -Deprecated. New code should use the :class:`PIL.ImageFile.Parser` -class in the :mod:`PIL.ImageFile` module instead. - -.. seealso:: modules :class:`PIL.ImageFile.Parser` -""" - -from io import BytesIO - - -class ImageFileIO(BytesIO): - def __init__(self, fp): - """ - Adds buffering to a stream file object, in order to - provide **seek** and **tell** methods required - by the :func:`PIL.Image.Image.open` method. The stream object must - implement **read** and **close** methods. - - :param fp: Stream file handle. - - .. seealso:: modules :func:`PIL.Image.open` - """ - data = fp.read() - BytesIO.__init__(self, data) diff --git a/Tests/test_imagefileio.py b/Tests/test_imagefileio.py deleted file mode 100644 index b06178437..000000000 --- a/Tests/test_imagefileio.py +++ /dev/null @@ -1,33 +0,0 @@ -from helper import unittest, PillowTestCase, hopper, tostring - -from PIL import Image -from PIL import ImageFileIO - - -class TestImageFileIo(PillowTestCase): - - def test_fileio(self): - - class DumbFile(object): - def __init__(self, data): - self.data = data - - def read(self, bytes=None): - assert(bytes is None) - return self.data - - def close(self): - pass - - im1 = hopper() - - io = ImageFileIO.ImageFileIO(DumbFile(tostring(im1, "PPM"))) - - im2 = Image.open(io) - self.assert_image_equal(im1, im2) - - -if __name__ == '__main__': - unittest.main() - -# End of file diff --git a/docs/PIL.rst b/docs/PIL.rst index 53a61872b..c171b80b1 100644 --- a/docs/PIL.rst +++ b/docs/PIL.rst @@ -64,15 +64,6 @@ can be found here. .. intentionally skipped documenting this because it's deprecated -:mod:`ImageFileIO` Module -------------------------- - -.. automodule:: PIL.ImageFileIO - :members: - :undoc-members: - :show-inheritance: - - :mod:`ImageShow` Module -----------------------