diff --git a/src/jpeglib/_bind.py b/src/jpeglib/_bind.py index b8d5891..7d353f2 100644 --- a/src/jpeglib/_bind.py +++ b/src/jpeglib/_bind.py @@ -155,7 +155,6 @@ def read_jpeg_spatial( if path is None: path = srcfile - flag_mask = cls.flags_to_mask(flags) status = cls.get().read_jpeg_spatial( cls.cstr(srcfile), spatial, @@ -164,9 +163,9 @@ def read_jpeg_spatial( out_color_space, dither_mode, dct_method, - flag_mask + cls.flags_to_mask(flags) ) - + if status == 0: raise IOError(f"reading of {path} spatial failed")