Class ImageArtifactProcessor
java.lang.Object
org.broadleafcommerce.openadmin.server.service.artifact.image.ImageArtifactProcessor
- All Implemented Interfaces:
ArtifactProcessor
@Service("blImageArtifactProcessor")
public class ImageArtifactProcessor
extends Object
implements ArtifactProcessor
Created by IntelliJ IDEA.
User: jfischer
Date: 9/10/11
Time: 11:58 AM
To change this template use File | Settings | File Templates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected EffectsManagerprotected Stringprotected String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildOperations(Map<String, String> parameterMap, InputStream artifactStream, String mimeType) protected InputStreamcompress(BufferedImage image, String formatName) protected InputStreamcompressPNG(InputStream artifactStream) convert(InputStream artifactStream, BufferedImageOp filter) convert(InputStream artifactStream, Operation[] operations, String mimeType) floatgetImageMetadata(InputStream artifactStream) String[]booleanisSupported(InputStream artifactStream, String filename) recompress(InputStream artifactStream, String[] filterFormats) Given an input stream on a media file, recompress the file according to best practice optimization standards.voidsetCompressionQuality(float compressionQuality) voidsetSupportedUploadTypes(String[] supportedUploadTypes) protected BufferedImagestripAlpha(BufferedImage image)
-
Field Details
-
effectsManager
-
supportedUploadTypes
-
compressionQuality
protected float compressionQuality -
recompressFormats
-
-
Constructor Details
-
ImageArtifactProcessor
public ImageArtifactProcessor()
-
-
Method Details
-
isSupported
- Specified by:
isSupportedin interfaceArtifactProcessor
-
buildOperations
public Operation[] buildOperations(Map<String, String> parameterMap, InputStream artifactStream, String mimeType) - Specified by:
buildOperationsin interfaceArtifactProcessor
-
getImageMetadata
- Throws:
Exception
-
convert
public InputStream convert(InputStream artifactStream, Operation[] operations, String mimeType) throws Exception - Specified by:
convertin interfaceArtifactProcessor- Throws:
Exception
-
convert
- Throws:
Exception
-
recompress
Given an input stream on a media file, recompress the file according to best practice optimization standards.- Parameters:
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.- Returns:
- Throws:
Exception
-
compressPNG
- Throws:
Exception
-
compress
- Throws:
Exception
-
stripAlpha
-
getSupportedUploadTypes
-
setSupportedUploadTypes
-
getCompressionQuality
public float getCompressionQuality() -
setCompressionQuality
public void setCompressionQuality(float compressionQuality)
-