_getexif()
is underscored because they don't want to commit to it always working the way it does now - the code says "This method is highly experimental, and is likely to be replaced with something better in a future version." Although, as far as I know, it's said that in PIL for ages.
So your choices are:
- suppress the lint warning
- get the raw (unparsed) exif data with
i.info.get('exif')
and parse it yourself, possibly with code ripped out of Pillow
- use a supported exif library like ExifRead
edit: really "don't want to commit to it always working the way it does now" is underselling it a bit - _getexif()
is for the library's own (very limited) internal use, and they recognise that parsing real exifs found in the wild, and giving a reliable result for all (even the weird ones) is a more significant undertaking than they're willing to sign up for.