Interface ImageEditingService


  • public interface ImageEditingService
    A service providing image editing through text commands.

    Example operation strings:

         crop:0:0:50:50
         resize:300:300:best-fit
         autorotate
         rotate180
         flipHorizontal
         flipVertical
         autorotate:crop:0:0:50%:50%:resize:500:300:best-fit:flipHorizontal
     
    • Method Detail

      • parseImage

        ParsedImage parseImage​(InputStream input)
        Parses an input stream.
        Parameters:
        input - input stream to read image from
        Returns:
        an Image including metadata
      • parseImage

        ParsedImage parseImage​(BufferedImage image)
        Parses an existing BufferedImage.
        Parameters:
        image - existing BufferedImage
        Returns:
        an Image including metadata
      • process

        ParsedImage process​(ParsedImage parsedImage,
                            String operationString)
        Processes an image according to an operation string.
        Parameters:
        parsedImage - the input image
        operationString - the required operations
        Returns:
        the processed image
      • writeImage

        void writeImage​(ParsedImage image,
                        OutputStream out)
        Writes an image to an output stream, using the file format information present in the image. If no file format is present, use the default of "JPEG".
        Parameters:
        image - the image to write
        out - the target output stream
      • getMetadata

        Map<String,​String> getMetadata​(ParsedImage parsedImage)
        Returns a map of image metadata.
        Parameters:
        parsedImage - the image to return metadata for
        Returns:
        a map of metadata