Loading imgutils/sd/nai/extract.py +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ class LSBExtractor(object): if self.row == self.rows: self.row = 0 self.col += 1 else: raise IOError('Cannot read more bits.') def get_one_byte(self): """ Loading imgutils/sd/nai/metadata.py +2 −1 Original line number Diff line number Diff line Loading @@ -96,10 +96,11 @@ def _get_naimeta_raw(image: ImageTyping) -> dict: image = load_image(image, force_background=None, mode=None) try: return ImageLsbDataExtractor().extract_data(image) except (ValueError, json.JSONDecodeError, zlib.error, OSError, UnicodeDecodeError): except (ValueError, json.JSONDecodeError, zlib.error, OSError, IOError, UnicodeDecodeError): # ValueError: binary data with wrong format # json.JSONDecodeError: zot a json-formatted data # zlib.error, OSError: not zlib compressed binary data # IOError: unable to read more from images # UnicodeDecodeError: cannot decode as utf-8 text return image.info or {} Loading Loading
imgutils/sd/nai/extract.py +2 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,8 @@ class LSBExtractor(object): if self.row == self.rows: self.row = 0 self.col += 1 else: raise IOError('Cannot read more bits.') def get_one_byte(self): """ Loading
imgutils/sd/nai/metadata.py +2 −1 Original line number Diff line number Diff line Loading @@ -96,10 +96,11 @@ def _get_naimeta_raw(image: ImageTyping) -> dict: image = load_image(image, force_background=None, mode=None) try: return ImageLsbDataExtractor().extract_data(image) except (ValueError, json.JSONDecodeError, zlib.error, OSError, UnicodeDecodeError): except (ValueError, json.JSONDecodeError, zlib.error, OSError, IOError, UnicodeDecodeError): # ValueError: binary data with wrong format # json.JSONDecodeError: zot a json-formatted data # zlib.error, OSError: not zlib compressed binary data # IOError: unable to read more from images # UnicodeDecodeError: cannot decode as utf-8 text return image.info or {} Loading