diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 14:07:48 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 14:07:48 +0200 |
commit | 5d86cfd98437eaa2b84b07ba19d51d50d64bc53f (patch) | |
tree | 735c4b2445a274be1440b75c7733d2805ff24307 /lib/Python/Lib/PIL/ImageFileIO.py | |
parent | Other import fixes (2) (diff) | |
download | pyload-5d86cfd98437eaa2b84b07ba19d51d50d64bc53f.tar.xz |
Missing optional lib
Diffstat (limited to 'lib/Python/Lib/PIL/ImageFileIO.py')
-rw-r--r-- | lib/Python/Lib/PIL/ImageFileIO.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Python/Lib/PIL/ImageFileIO.py b/lib/Python/Lib/PIL/ImageFileIO.py new file mode 100644 index 000000000..e57d3f43e --- /dev/null +++ b/lib/Python/Lib/PIL/ImageFileIO.py @@ -0,0 +1,40 @@ +# +# 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) |