@@ -540,27 +540,27 @@ class SerializableImage(FileBasedImage):
540
540
"""
541
541
542
542
@classmethod
543
- def _filemap_from_iobase (klass , ioobject : io .IOBase ):
543
+ def _filemap_from_iobase (klass , io_obj : io .IOBase ):
544
544
"""For single-file image types, make a file map with the correct key"""
545
545
if len (klass .files_types ) > 1 :
546
546
raise NotImplementedError (
547
547
"(de)serialization is undefined for multi-file images"
548
548
)
549
- return klass .make_file_map ({klass .files_types [0 ][0 ]: ioobject })
549
+ return klass .make_file_map ({klass .files_types [0 ][0 ]: io_obj })
550
550
551
551
@classmethod
552
- def _from_iobase (klass , ioobject : io .IOBase ):
552
+ def _from_iobase (klass , io_obj : io .IOBase ):
553
553
"""Load image from readable IO stream
554
554
555
555
Convert to BytesIO to enable seeking, if input stream is not seekable
556
556
"""
557
- if not ioobject .seekable ():
558
- ioobject = io .BytesIO (ioobject .read ())
559
- return klass .from_file_map (klass ._filemap_from_iobase (ioobject ))
557
+ if not io_obj .seekable ():
558
+ io_obj = io .BytesIO (io_obj .read ())
559
+ return klass .from_file_map (klass ._filemap_from_iobase (io_obj ))
560
560
561
- def _to_iobase (self , ioobject : io .IOBase , ** kwargs ):
561
+ def _to_iobase (self , io_obj : io .IOBase , ** kwargs ):
562
562
"""Save image from writable IO stream"""
563
- self .to_file_map (self ._filemap_from_iobase (ioobject ), ** kwargs )
563
+ self .to_file_map (self ._filemap_from_iobase (io_obj ), ** kwargs )
564
564
565
565
@classmethod
566
566
def from_bytes (klass , bytestring : bytes ):
0 commit comments