def crop_image(self):
    box = [(self.box[0] * self.scale), (self.box[1] * self.scale), (self.box[2] * self.scale), (self.box[3] * self.scale)]
    cropped = self.img.crop(box)
    if ((cropped.size[0] == 0) and (cropped.size[1] == 0)):
        print('image has no size!!!')
    if (not (((cropped.size[0] * cropped.size[1]) % self.boxBasePx) == 0)):
        return None
    return cropped
def crop_image(self):
    box = [(self.box[0] * self.scale), (self.box[1] * self.scale), (self.box[2] * self.scale), (self.box[3] * self.scale)]
    cropped = self.img.crop(box)
    if ((cropped.size[0] == 0) and (cropped.size[1] == 0)):
        print('image has no size!!!')
    if (not (((cropped.size[0] * cropped.size[1]) % self.boxBasePx) == 0)):
        return None
    return cropped