':param fd: Underlying image file object'

def __init__(self, fd):

    self.fd = fd
    self.iterator = None
    if hasattr(fd, 'read'):
        self.read = cooperative_read(fd)
    else:
        self.iterator = None
        self.buffer = ''
        self.position = 0
