@Service(value="blImageArtifactProcessor") public class ImageArtifactProcessor extends Object implements ArtifactProcessor
| Modifier and Type | Field and Description |
|---|---|
protected float |
compressionQuality |
protected EffectsManager |
effectsManager |
protected String |
recompressFormats |
protected String[] |
supportedUploadTypes |
| Constructor and Description |
|---|
ImageArtifactProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Operation[] |
buildOperations(Map<String,String> parameterMap,
InputStream artifactStream,
String mimeType) |
protected InputStream |
compress(BufferedImage image,
String formatName) |
protected InputStream |
compressPNG(InputStream artifactStream) |
InputStream |
convert(InputStream artifactStream,
BufferedImageOp filter) |
InputStream |
convert(InputStream artifactStream,
Operation[] operations,
String mimeType) |
float |
getCompressionQuality() |
ImageMetadata |
getImageMetadata(InputStream artifactStream) |
String[] |
getSupportedUploadTypes() |
boolean |
isSupported(InputStream artifactStream,
String filename) |
InputStream |
recompress(InputStream artifactStream,
String[] filterFormats)
Given an input stream on a media file, recompress the file according to best practice optimization standards.
|
void |
setCompressionQuality(float compressionQuality) |
void |
setSupportedUploadTypes(String[] supportedUploadTypes) |
protected BufferedImage |
stripAlpha(BufferedImage image) |
protected EffectsManager effectsManager
protected String[] supportedUploadTypes
protected float compressionQuality
@Value(value="${image.artifact.recompress.formats:png}")
protected String recompressFormats
public boolean isSupported(InputStream artifactStream, String filename)
isSupported in interface ArtifactProcessorpublic Operation[] buildOperations(Map<String,String> parameterMap, InputStream artifactStream, String mimeType)
buildOperations in interface ArtifactProcessorpublic ImageMetadata getImageMetadata(InputStream artifactStream) throws Exception
Exceptionpublic InputStream convert(InputStream artifactStream, Operation[] operations, String mimeType) throws Exception
convert in interface ArtifactProcessorExceptionpublic InputStream convert(InputStream artifactStream, BufferedImageOp filter) throws Exception
Exceptionpublic InputStream recompress(InputStream artifactStream, String[] filterFormats) throws Exception
artifactStream - The media input streamfilterFormats - A list of formats to reduce the scope of influence. When specified, only media matching the
included formats will be processed. Can be null to cause all formats to be processed.Exceptionprotected InputStream compressPNG(InputStream artifactStream) throws Exception
Exceptionprotected InputStream compress(BufferedImage image, String formatName) throws Exception
Exceptionprotected BufferedImage stripAlpha(BufferedImage image)
public String[] getSupportedUploadTypes()
public void setSupportedUploadTypes(String[] supportedUploadTypes)
public float getCompressionQuality()
public void setCompressionQuality(float compressionQuality)
Copyright © 2021. All rights reserved.