log undecodeable gif images

This commit is contained in:
Kovid Goyal 2022-05-02 23:04:07 +05:30
parent ec0b86de4b
commit cfce9a559d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -916,6 +916,7 @@ class MobiReader:
except AnimatedGIF: except AnimatedGIF:
pass pass
except OSError: except OSError:
self.log.warn(f'Ignoring undecodeable GIF image at index {image_index}')
continue continue
path = os.path.join(output_dir, '%05d.%s' % (image_index, imgfmt)) path = os.path.join(output_dir, '%05d.%s' % (image_index, imgfmt))
image_name_map[image_index] = os.path.basename(path) image_name_map[image_index] = os.path.basename(path)