com.liferay.portal.image
Class ImageToolImpl
java.lang.Object
com.liferay.portal.image.ImageToolImpl
- All Implemented Interfaces:
- ImageTool
public class ImageToolImpl
- extends Object
- implements ImageTool
Method Summary |
void |
afterPropertiesSet()
|
Future<RenderedImage> |
convertCMYKtoRGB(byte[] bytes,
String type)
|
BufferedImage |
convertImageType(BufferedImage sourceImage,
int type)
|
protected RenderedImage |
doScale(RenderedImage renderedImage,
int scaledHeight,
int scaledWidth)
|
void |
encodeGIF(RenderedImage renderedImage,
OutputStream os)
|
void |
encodeWBMP(RenderedImage renderedImage,
OutputStream os)
|
BufferedImage |
getBufferedImage(RenderedImage renderedImage)
|
byte[] |
getBytes(RenderedImage renderedImage,
String contentType)
|
Image |
getDefaultCompanyLogo()
|
Image |
getDefaultOrganizationLogo()
|
Image |
getDefaultSpacer()
|
Image |
getDefaultUserFemalePortrait()
|
Image |
getDefaultUserMalePortrait()
|
Image |
getImage(byte[] bytes)
|
Image |
getImage(File file)
|
Image |
getImage(InputStream is)
|
Image |
getImage(InputStream is,
boolean cleanUpStream)
|
protected ImageMagick |
getImageMagick()
|
static ImageTool |
getInstance()
|
boolean |
isNullOrDefaultSpacer(byte[] bytes)
|
ImageBag |
read(byte[] bytes)
|
protected RenderedImage |
read(byte[] bytes,
String type)
|
ImageBag |
read(File file)
|
ImageBag |
read(InputStream inputStream)
|
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageToolImpl
public ImageToolImpl()
getInstance
public static ImageTool getInstance()
afterPropertiesSet
public void afterPropertiesSet()
convertCMYKtoRGB
public Future<RenderedImage> convertCMYKtoRGB(byte[] bytes,
String type)
- Specified by:
convertCMYKtoRGB
in interface ImageTool
convertImageType
public BufferedImage convertImageType(BufferedImage sourceImage,
int type)
- Specified by:
convertImageType
in interface ImageTool
encodeGIF
public void encodeGIF(RenderedImage renderedImage,
OutputStream os)
throws IOException
- Specified by:
encodeGIF
in interface ImageTool
- Throws:
IOException
encodeWBMP
public void encodeWBMP(RenderedImage renderedImage,
OutputStream os)
throws IOException
- Specified by:
encodeWBMP
in interface ImageTool
- Throws:
IOException
getBufferedImage
public BufferedImage getBufferedImage(RenderedImage renderedImage)
- Specified by:
getBufferedImage
in interface ImageTool
getBytes
public byte[] getBytes(RenderedImage renderedImage,
String contentType)
throws IOException
- Specified by:
getBytes
in interface ImageTool
- Throws:
IOException
getDefaultCompanyLogo
public Image getDefaultCompanyLogo()
- Specified by:
getDefaultCompanyLogo
in interface ImageTool
getDefaultOrganizationLogo
public Image getDefaultOrganizationLogo()
- Specified by:
getDefaultOrganizationLogo
in interface ImageTool
getDefaultSpacer
public Image getDefaultSpacer()
- Specified by:
getDefaultSpacer
in interface ImageTool
getDefaultUserFemalePortrait
public Image getDefaultUserFemalePortrait()
- Specified by:
getDefaultUserFemalePortrait
in interface ImageTool
getDefaultUserMalePortrait
public Image getDefaultUserMalePortrait()
- Specified by:
getDefaultUserMalePortrait
in interface ImageTool
getImage
public Image getImage(byte[] bytes)
throws IOException
- Specified by:
getImage
in interface ImageTool
- Throws:
IOException
getImage
public Image getImage(File file)
throws IOException
- Specified by:
getImage
in interface ImageTool
- Throws:
IOException
getImage
public Image getImage(InputStream is)
throws IOException
- Specified by:
getImage
in interface ImageTool
- Throws:
IOException
getImage
public Image getImage(InputStream is,
boolean cleanUpStream)
throws IOException
- Specified by:
getImage
in interface ImageTool
- Throws:
IOException
isNullOrDefaultSpacer
public boolean isNullOrDefaultSpacer(byte[] bytes)
- Specified by:
isNullOrDefaultSpacer
in interface ImageTool
read
public ImageBag read(byte[] bytes)
throws IOException
- Specified by:
read
in interface ImageTool
- Throws:
IOException
read
public ImageBag read(File file)
throws IOException
- Specified by:
read
in interface ImageTool
- Throws:
IOException
read
public ImageBag read(InputStream inputStream)
throws IOException
- Specified by:
read
in interface ImageTool
- Throws:
IOException
scale
public RenderedImage scale(RenderedImage renderedImage,
int width)
- Specified by:
scale
in interface ImageTool
scale
public RenderedImage scale(RenderedImage renderedImage,
int maxHeight,
int maxWidth)
- Specified by:
scale
in interface ImageTool
write
public void write(RenderedImage renderedImage,
String contentType,
OutputStream os)
throws IOException
- Specified by:
write
in interface ImageTool
- Throws:
IOException
doScale
protected RenderedImage doScale(RenderedImage renderedImage,
int scaledHeight,
int scaledWidth)
getImageMagick
protected ImageMagick getImageMagick()
read
protected RenderedImage read(byte[] bytes,
String type)
toMultiByte
protected byte[] toMultiByte(int intValue)