public class ImageToolImpl
extends Object
implements com.liferay.portal.kernel.image.ImageTool
ORIENTATION_VALUE_HORIZONTAL_NORMAL, ORIENTATION_VALUE_MIRROR_HORIZONTAL, ORIENTATION_VALUE_MIRROR_HORIZONTAL_ROTATE_270_CW, ORIENTATION_VALUE_MIRROR_HORIZONTAL_ROTATE_90_CW, ORIENTATION_VALUE_MIRROR_VERTICAL, ORIENTATION_VALUE_ROTATE_180, ORIENTATION_VALUE_ROTATE_270_CW, ORIENTATION_VALUE_ROTATE_90_CW, TYPE_BMP, TYPE_GIF, TYPE_JPEG, TYPE_NOT_AVAILABLE, TYPE_PNG, TYPE_TIFF
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Future<RenderedImage> |
convertCMYKtoRGB(byte[] bytes,
String type) |
BufferedImage |
convertImageType(BufferedImage sourceImage,
int type) |
RenderedImage |
crop(RenderedImage renderedImage,
int height,
int width,
int x,
int y) |
protected RenderedImage |
doScale(RenderedImage renderedImage,
int scaledHeight,
int scaledWidth) |
void |
encodeGIF(RenderedImage renderedImage,
OutputStream os) |
void |
encodeWBMP(RenderedImage renderedImage,
OutputStream os) |
RenderedImage |
flipHorizontal(RenderedImage renderedImage) |
RenderedImage |
flipVertical(RenderedImage renderedImage) |
BufferedImage |
getBufferedImage(RenderedImage renderedImage) |
byte[] |
getBytes(RenderedImage renderedImage,
String contentType) |
com.liferay.portal.kernel.model.Image |
getDefaultCompanyLogo() |
com.liferay.portal.kernel.model.Image |
getDefaultOrganizationLogo() |
com.liferay.portal.kernel.model.Image |
getDefaultSpacer() |
com.liferay.portal.kernel.model.Image |
getDefaultUserFemalePortrait() |
com.liferay.portal.kernel.model.Image |
getDefaultUserMalePortrait() |
com.liferay.portal.kernel.model.Image |
getImage(byte[] bytes) |
com.liferay.portal.kernel.model.Image |
getImage(File file) |
com.liferay.portal.kernel.model.Image |
getImage(InputStream is) |
com.liferay.portal.kernel.model.Image |
getImage(InputStream is,
boolean cleanUpStream) |
protected com.liferay.portal.kernel.image.ImageMagick |
getImageMagick() |
static com.liferay.portal.kernel.image.ImageTool |
getInstance() |
boolean |
isNullOrDefaultSpacer(byte[] bytes) |
protected void |
orderImageReaderSpis() |
com.liferay.portal.kernel.image.ImageBag |
read(byte[] bytes) |
com.liferay.portal.kernel.image.ImageBag |
read(File file) |
com.liferay.portal.kernel.image.ImageBag |
read(InputStream inputStream) |
RenderedImage |
rotate(RenderedImage renderedImage,
int degrees) |
RenderedImage |
scale(RenderedImage renderedImage,
int width) |
RenderedImage |
scale(RenderedImage renderedImage,
int maxHeight,
int maxWidth) |
protected byte[] |
toMultiByte(int intValue) |
void |
write(RenderedImage renderedImage,
String contentType,
OutputStream os) |
public static com.liferay.portal.kernel.image.ImageTool getInstance()
public void afterPropertiesSet()
public Future<RenderedImage> convertCMYKtoRGB(byte[] bytes, String type)
convertCMYKtoRGB
in interface com.liferay.portal.kernel.image.ImageTool
public BufferedImage convertImageType(BufferedImage sourceImage, int type)
convertImageType
in interface com.liferay.portal.kernel.image.ImageTool
public RenderedImage crop(RenderedImage renderedImage, int height, int width, int x, int y)
crop
in interface com.liferay.portal.kernel.image.ImageTool
public void encodeGIF(RenderedImage renderedImage, OutputStream os) throws IOException
encodeGIF
in interface com.liferay.portal.kernel.image.ImageTool
IOException
public void encodeWBMP(RenderedImage renderedImage, OutputStream os) throws IOException
encodeWBMP
in interface com.liferay.portal.kernel.image.ImageTool
IOException
public RenderedImage flipHorizontal(RenderedImage renderedImage)
flipHorizontal
in interface com.liferay.portal.kernel.image.ImageTool
public RenderedImage flipVertical(RenderedImage renderedImage)
flipVertical
in interface com.liferay.portal.kernel.image.ImageTool
public BufferedImage getBufferedImage(RenderedImage renderedImage)
getBufferedImage
in interface com.liferay.portal.kernel.image.ImageTool
public byte[] getBytes(RenderedImage renderedImage, String contentType) throws IOException
getBytes
in interface com.liferay.portal.kernel.image.ImageTool
IOException
public com.liferay.portal.kernel.model.Image getDefaultCompanyLogo()
getDefaultCompanyLogo
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.model.Image getDefaultOrganizationLogo()
getDefaultOrganizationLogo
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.model.Image getDefaultSpacer()
getDefaultSpacer
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.model.Image getDefaultUserFemalePortrait()
getDefaultUserFemalePortrait
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.model.Image getDefaultUserMalePortrait()
getDefaultUserMalePortrait
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.model.Image getImage(byte[] bytes) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
getImage
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public com.liferay.portal.kernel.model.Image getImage(File file) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
getImage
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public com.liferay.portal.kernel.model.Image getImage(InputStream is) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
getImage
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public com.liferay.portal.kernel.model.Image getImage(InputStream is, boolean cleanUpStream) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
getImage
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public boolean isNullOrDefaultSpacer(byte[] bytes)
isNullOrDefaultSpacer
in interface com.liferay.portal.kernel.image.ImageTool
public com.liferay.portal.kernel.image.ImageBag read(byte[] bytes) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
read
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public com.liferay.portal.kernel.image.ImageBag read(File file) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
read
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public com.liferay.portal.kernel.image.ImageBag read(InputStream inputStream) throws com.liferay.portal.kernel.exception.ImageResolutionException, IOException
read
in interface com.liferay.portal.kernel.image.ImageTool
com.liferay.portal.kernel.exception.ImageResolutionException
IOException
public RenderedImage rotate(RenderedImage renderedImage, int degrees)
rotate
in interface com.liferay.portal.kernel.image.ImageTool
public RenderedImage scale(RenderedImage renderedImage, int width)
scale
in interface com.liferay.portal.kernel.image.ImageTool
public RenderedImage scale(RenderedImage renderedImage, int maxHeight, int maxWidth)
scale
in interface com.liferay.portal.kernel.image.ImageTool
public void write(RenderedImage renderedImage, String contentType, OutputStream os) throws IOException
write
in interface com.liferay.portal.kernel.image.ImageTool
IOException
protected RenderedImage doScale(RenderedImage renderedImage, int scaledHeight, int scaledWidth)
protected com.liferay.portal.kernel.image.ImageMagick getImageMagick()
protected void orderImageReaderSpis()
protected byte[] toMultiByte(int intValue)