Interface IImageThumbnailGenerator

    • Method Detail

      • generateThumbnail

        TypedByteArray generateThumbnail​(byte[] data,
                                         ImageThumbnailGeneratorConstraints constraints)
                                  throws IOException
        Generate a thumbnail for the given image data.
        Parameters:
        data - The image data.
        constraints - Requested constraints on the thumbnail generation. May or may not be respected by the implementation. null if no constraints are specified.
        Returns:
        The generated thumbnail, including its content type (MIME type).
        Throws:
        IOException - If the thumbnail could not be generated.
      • generateThumbnail

        TypedFile generateThumbnail​(Path sourceImage,
                                    Path outputLocation,
                                    ImageThumbnailGeneratorConstraints constraints)
                             throws IOException
        Generate a thumbnail for the given image file, and stores it at the specified output location. The output location may be either an existing directory, in which case a new file is created within that directory, or a file path. If the file exists, it is overwritten.
        Parameters:
        sourceImage - The image file for which to generate a thumbnail.
        outputLocation - Where to store the thumbnail. Either an existing folder or a file path.
        constraints - Requested constraints on the thumbnail generation. May or may not be respected by the implementation. null if no constraints are specified.
        Returns:
        The generated thumbnail file.
        Throws:
        IOException - If the thumbnail could not be generated.
      • generateThumbnail

        TypedFile generateThumbnail​(String sourceFileName,
                                    InputStream sourceImage,
                                    Path outputLocation,
                                    ImageThumbnailGeneratorConstraints constraints)
                             throws IOException
        Generate a thumbnail for the given image file, and stores it at the specified output location. The output location may be either an existing directory, in which case a new file is created within that directory, or a file path. If the file exists, it is overwritten.
        Parameters:
        sourceFileName - The name of the image file for which to generate a thumbnail.
        sourceImage - The data of the image file for which to generate a thumbnail.
        outputLocation - Where to store the thumbnail. Either an existing folder or a file path.
        constraints - Requested constraints on the thumbnail generation. May or may not be respected by the implementation. null if no constraints are specified.
        Returns:
        The generated thumbnail file.
        Throws:
        IOException - If the thumbnail could not be generated.