# # 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. # from io import BytesIO ## # The ImageFileIO module can be used to read an image from a # socket, or any other stream device. #
# This module is deprecated. New code should use the Parser # class in the ImageFile module instead. # # @see ImageFile#Parser class ImageFileIO(BytesIO): ## # Adds buffering to a stream file object, in order to # provide seek and tell methods required # by the Image.open method. The stream object must # implement read and close methods. # # @param fp Stream file handle. # @see Image#open def __init__(self, fp): data = fp.read() BytesIO.__init__(self, data)