def rotate(img, rotation_angle):
    """
    Rotate image
    :param img: PIL image object
    :param rotation_angle: Rotate in degrees
    :return: PIL image object
    """
    try:
        img_rotated = img.rotate(rotation_angle)
        return img_rotated
    except IOError as e:
        print(e)