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