def crop_area(crop):
    """calculate the area of a crop (x1, y1, x2, y2).

    Adapted from https://github.com/danvk/oldnyc/blob/master/ocr/tess/crop_morphology.py
    Copyright 2015 danvk.
    http://www.apache.org/licenses/LICENSE-2.0

    :param crop: crop coordinates
    :type crop: tuple
    :return: area of the crop
    :rtype: int
    """
    x1, y1, x2, y2 = crop
    return max(0, x2 - x1) * max(0, y2 - y1)