def get_image_ratio(self, image, options):
cropbox = options['<STR_LIT>']<EOL>if cropbox:<EOL><INDENT>x, y, x2, y2 = parse_cropbox(cropbox)<EOL>x = x2 - x<EOL>y = y2 - y<EOL><DEDENT>else:<EOL><INDENT>x, y = self.get_image_size(image)<EOL><DEDENT>return float(x) / y<EOL>
Calculates the image ratio. If cropbox option is used, the ratio
may have changed.