def parse_cropbox(cropbox):
    """
    Returns x, y, x2, y2 tuple for cropping.
    """
    if isinstance(cropbox, six.text_type):
        return tuple([int(x.strip()) for x in cropbox.split(',')])
    else:
        return tuple(cropbox)