code: def scale(self, image, geometry, options):
          
          upscale = options['upscale']
          x_image, y_image = map(float, self.get_image_size(image))
          factor = self._calculate_scaling_factor(x_image, y_image, geometry, options)
  
          if factor < 1 or upscale:
              width = toint(x_image * factor)
              height = toint(y_image * factor)
              image = self._scale(image, width, height)
  
          return image
docs: Wrapper for ``_scale``