def scale(self, image, size, crop, options):
        """
        Wrapper for ``engine_scale``, checks if the scaling factor is below one or that scale_up
        option is set to True before calling ``engine_scale``.

        :param image:
        :param size:
        :param crop:
        :param options:
        :return:
        """
        original_size = self.get_image_size(image)
        factor = self._calculate_scaling_factor(original_size, size, crop is not None)

        if factor < 1 or options['scale_up']:
            width = int(original_size[0] * factor)
            height = int(original_size[1] * factor)
            image = self.engine_scale(image, width, height)

        return image
def scale ( self , image , size , crop , options ) : original_size = self . get_image_size ( image ) factor = self . _calculate_scaling_factor ( original_size , size , crop is not None ) if factor < 1 or options [ 'scale_up' ] : width = int ( original_size [ 0 ] * factor ) height = int ( original_size [ 1 ] * factor ) image = self . engine_scale ( image , width , height ) return image
Wrapper for ``engine_scale``, checks if the scaling factor is below one or that scale_up
        option is set to True before calling ``engine_scale``.

        :param image:
        :param size:
        :param crop:
        :param options:
        :return: