Allow writing IFDRational to UNDEFINED tag by radarhere · Pull Request #7840 · python-pillow/Pillow

Resolves #7839. Similar to #6890

The issue provides an image where the InteropVersion tag has type RATIONAL.
https://exiftool.org/TagNames/EXIF.html states that it should have type UNDEFINED. The tag is loaded as RATIONALs, but this causes an error when Pillow tries to write it as UNDEFINED when saving the EXIF data.

This PR simply handles the IFDRational value when saving UNDEFINED tags.