def _most_constraining(constraining, target_aspect):
    """Find most constraining dimension to scale."""
    if constraining[0] / float(constraining[1]) >= target_aspect[0] / float(
        target_aspect[1]):
        return 1
    else:
        return 0
