def image_orientation(style, name, values):
    """Compute the ``image-orientation`` properties."""
    if values in ('none', 'from-image'):
        return values
    angle, flip = values
    return (int(round(angle / pi * 2)) % 4 * 90, flip)
Compute the ``image-orientation`` properties.
weasyprint/css/computed_values.py