Package com.iknowbase.api.imageeditor
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ImageEditingService.OPERATIONS
The various operations
-
Field Summary
Fields Modifier and Type Field Description static String
RESIZE_MODE_BEST_FIT
static String
RESIZE_MODE_BEST_FIT_SHRINK
static String
RESIZE_MODE_EXACT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String>
getMetadata(ParsedImage parsedImage)
Returns a map of image metadata.ParsedImage
parseImage(BufferedImage image)
Parses an existing BufferedImage.ParsedImage
parseImage(InputStream input)
Parses an input stream.ParsedImage
process(ParsedImage parsedImage, String operationString)
Processes an image according to an operation string.void
writeImage(ParsedImage image, OutputStream out)
Writes an image to an output stream, using the file format information present in the image.
-
-
-
Field Detail
-
RESIZE_MODE_BEST_FIT_SHRINK
static final String RESIZE_MODE_BEST_FIT_SHRINK
- See Also:
- Constant Field Values
-
RESIZE_MODE_BEST_FIT
static final String RESIZE_MODE_BEST_FIT
- See Also:
- Constant Field Values
-
RESIZE_MODE_EXACT
static final String RESIZE_MODE_EXACT
- See Also:
- Constant Field Values
-
-
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 imageoperationString
- 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 writeout
- 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
-
-