Package de.xima.fc.common.image
Interface IImageThumbnailGenerator
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
CropScaleImageThumbnailGenerator
public interface IImageThumbnailGenerator extends Serializable
Interface for objects that can generate thumbnails for images.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypedByteArray
generateThumbnail(byte[] data, ImageThumbnailGeneratorConstraints constraints)
Generate a thumbnail for the given image data.TypedFile
generateThumbnail(String sourceFileName, InputStream sourceImage, Path outputLocation, ImageThumbnailGeneratorConstraints constraints)
Generate a thumbnail for the given image file, and stores it at the specified output location.TypedFile
generateThumbnail(Path sourceImage, Path outputLocation, ImageThumbnailGeneratorConstraints constraints)
Generate a thumbnail for the given image file, and stores it at the specified output location.
-
-
-
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.
-
-