Exemplo n.º 1
0
def decode(fileobj):
    reader = Reader(fileobj=fileobj)
    try:
        return reader.get_image()
    except PNGReaderError:
        fileobj.seek(0)
        return None
Exemplo n.º 2
0
 def open(fileobj):
     reader = Reader(fileobj=fileobj)
     try:
         return reader.get_image()
     except FormatError:
         fileobj.seek(0)
         return None