wagtail/wagtailimages/models.py
def process_image(self, input_file, output_file=None, focal_point=None, backend_name='default'):
        """
        Run this filter on the given image file then write the result into output_file and return it
        If output_file is not given, a new BytesIO will be used instead
        """
        # Get backend
        backend = get_image_backend(backend_name)

        # Parse spec string
        method_name, method_arg = self._method

        # Open image
        input_file.open('rb')
        image = backend.open_image(input_file)
        file_format = image.format

        # Process image
        method = getattr(backend, method_name)
        image = method(image, method_arg, focal_point=focal_point)

        # Make sure we have an output file
        if output_file is None:
            output_file = BytesIO()

        # Write output
        backend.save_image(image, output_file, file_format)

        # Close the input file
        input_file.close()

        return output_file

        Run this filter on the given image file then write the result into output_file and return it
        If output_file is not given, a new BytesIO will be used instead
        
Run this filter on the given image file then write the result into output_file and return it
If output_file is not given, a new BytesIO will be used instead
Run this filter on the given image file then write the result into output_file and return it If output_file is not given a new BytesIO will be used instead
def process_image(self, input_file, output_file=None, focal_point=None, backend_name='default'):
        backend = get_image_backend(backend_name)
        method_name, method_arg = self._method
        input_file.open('rb')
        image = backend.open_image(input_file)
        file_format = image.format
        method = getattr(backend, method_name)
        image = method(image, method_arg, focal_point=focal_point)
        if output_file is None:
            output_file = BytesIO()
        backend.save_image(image, output_file, file_format)
        input_file.close()
        return output_file
def process_image ( self , input_file , output_file = None , focal_point = None , backend_name = 'default' ) : backend = get_image_backend ( backend_name ) method_name , method_arg = self . _method input_file . open ( 'rb' ) image = backend . open_image ( input_file ) file_format = image . format method = getattr ( backend , method_name ) image = method ( image , method_arg , focal_point = focal_point ) if output_file is None : output_file = BytesIO ( ) backend . save_image ( image , output_file , file_format ) input_file . close ( ) return output_file
Run this filter on the given image file then write the result into output_file and return it
If output_file is not given, a new BytesIO will be used instead
Run this filter on the given image file then write the result into output_file and return it If output_file is not given a new BytesIO will be used instead
"""
        Run this filter on the given image file then write the result into output_file and return it
        If output_file is not given, a new BytesIO will be used instead
        """ # Get backend # Parse spec string # Open image # Process image # Make sure we have an output file # Write output # Close the input file
self
input_file
output_file
focal_point
backend_name