<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rotate_exif(self):
 """ Rotate image via exif information. Only 90, 180 and 270 rotations are supported. """

        exif = self.image._getexif() or {}
        rotation = exif.get(TAGS['Orientation'], 1)

        rotations = {
            6: -90,
            3: -180,
            8: -270,
        }
        if rotation not in rotations:
            return

        self.image = self.image.rotate(rotations[rotation])