Handling decoding errors such as UnidentifiedImageError

Pillow version 10.1.0, the current version.