def crop(self, image, geometry, options):
crop = options['<STR_LIT>']<EOL>x_image, y_image = self.get_image_size(image)<EOL>if not crop or crop == '<STR_LIT>':<EOL><INDENT>return image<EOL><DEDENT>elif crop == '<STR_LIT>':<EOL><INDENT>return self._entropy_crop(image, geometry[<NUM_LIT:0>], geometry[<NUM_LIT:1>], x_image, y_image)<EOL><DEDENT>geometry = (min(x_image, geometry[<NUM_LIT:0>]), min(y_image, geometry[<NUM_LIT:1>]))<EOL>x_offset, y_offset = parse_crop(crop, (x_image, y_image), geometry)<EOL>return self._crop(image, geometry[<NUM_LIT:0>], geometry[<NUM_LIT:1>], x_offset, y_offset)<EOL>
Wrapper for ``_crop``